3.0.0 • Published 3 months ago

@krakenjs/webpack-mem-compile v3.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

webpack memory compile

build status code coverage npm version apache license

Compile from a webpack config to a string in memory.

Install

npm install --save @krakenjs/webpack-mem-compile

Note: this package is requires webpack@4 as a peer dependency

Use

Using a webpack config with an entry point:

import { webpackCompile } from '@krakenjs/webpack-mem-compile';

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

Using raw code:

import { webpackCompile } from "@krakenjs/webpack-mem-compile";

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