webpack-mem-compile

v1.0.2
Webpack compile to memory

webpack memory compile

Compile from a webpack config to a string in memory.

Install

npm install --save webpack-mem-compile

Use

Using a webpack config with an entry point:

import { webpackCompile } from 'webpack-mem-compile';

const code = await webpackCompile({
    webpack,
    config: {
        entry: 'foo.js';
    }
})

Using raw code:

import { webpackCompile } from 'webpack-mem-compile';

const code = await webpackCompile({
    webpack,
    code: `
        console.log('Hello World!');
    `
})
npm i webpack-mem-compile

Metadata

  • MIT
  • >= 6
  • dbrain
  • released 11/10/2018

Downloads

Maintainers