How to use the vue-loader/lib/component-normalizer function in vue-loader

To help you get started, we’ve selected a few vue-loader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imachug / zms / main / src / libs / theme.js View on Github external
const context = new ThemeContext(files, srcContext);

		for(const name of Object.keys(COMPONENTS)) {
			const compPath = COMPONENTS[name];

			if(!context.has(`./${compPath}`, "./src/theme")) {
				throw new ThemeFileNotFoundError(compPath);
			}

			const ex = context.require(`./${compPath}`, "./src/theme").default;

			const injectStyle = () => {
				addStylesClient(ex.options.scopeId, ex.allCss, true, ex.options);
			};
			const Component = normalizeComponent(
				ex.mExports,
				{
					render: ex.render,
					staticRenderFns: ex.staticRenderFns
				},
				false,
				injectStyle,
				ex.options.scopeId,
				null
			);

			Vue.component(name, Component.exports);
		}

		context.require("./global.sass", "./src/theme");
	}