1.0.0 • Published 4 years ago

mempack v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

mempack

Run a Webpack build in-memory

Install

$ npm install mempack

Usage

const mempack = require('mempack');

(async () => {
	const built = await mempack({
		files: [
			// Entry point
			{
				name: 'index.js',
				content: `
				import string from './string.js';

				console.log(string);
				`,
			},
			{
				name: 'string.js',
				content: `
				export default 'hello world';
				`
			},
		],

		// Configure webpack
		config: ({ config, addons merge }) =>

			addons(config, ['babel', 'vue']), // for adding Babel and Vue (from in lib/addons)

			merge.smart(config, { ... }), // ... or use webpack-merge

	});
})();

License

MIT