npm.io
1.0.0 • Published 6 years ago

mempack

Licence
MIT
Version
1.0.0
Deps
21
Size
390 kB
Vulns
6
Weekly
0
Stars
1

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

Keywords