Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

krakenjs/webpack-mem-compile

Folders and files

NameName
Last commit message
Last commit date
Mar 21, 2023
Jun 27, 2022
Dec 5, 2022
Dec 5, 2022
Dec 5, 2022
Dec 5, 2022
Dec 5, 2022
Dec 5, 2022
Jul 20, 2022
Jun 27, 2022
Jun 27, 2022
Dec 5, 2022
Mar 29, 2022
Dec 20, 2022
Dec 5, 2022
Jun 27, 2022
Dec 5, 2022
Dec 5, 2022
Dec 5, 2022
Dec 5, 2022

Repository files navigation

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!');
    `,
});