@pixeloven/webpack-compiler
Pixel Oven webpack-compiler.
See our website pixeloven-webpack-compiler for more information or the issues associated with this package.
Install
Using npm:
npm install --save @pixeloven/webpack-compiler
or using yarn:
yarn add @pixeloven/webpack-compiler
Usage
Note it's required that we provide a "client" and "server" configuration as an array to webpack.
The primary function of this module is to act as a wrapper class for webpack's compiler. Additionally it Provides functionality useful for interfacing with webpack's compiler and it's corresponding configuration and output.
-
create
- This static method will return us a new Compiler instance based on our desired configuration.
// webpack.config.js
export default [
{
name: 'client',
target: 'web',
entry: './client.js'
...
}, {
name: 'server',
target: 'node',
entry: './server.js'
...
}
];
We can take this configuration and compile it like shown below.
import { Compiler } from "@pixeloven/webpack-compiler";
import configs from "./webpack.config.js"
Compiler.create(configs);