@taqtile/ts-webpack-builder
v0.7.9
Published
Functional building composers for webpack config
Downloads
316
Readme
ts-webpack-builder
A functional builder for webpack config written in Typescript.
This package was heavily inspired on webpack-blocks.
Basic usage
import {
createConfig,
setEntry,
setOutput,
setPlugin,
} from '@taqtile/ts-webpack-builder';
module.exports = createConfig([
setEntry({
app: './src/app.ts',
}),
addRule(/\.ts?$/, 'awesome-typescript-loader', [/node_modules/]),
setOutput({
path: root('dist/public'),
filename: '[name].bundle.js',
sourceMapFilename: '[name].map',
chunkFilename: '[name].chunk.js',
}),
onCondition(process.env.ENV === 'development', [
setDevServer({
port: +process.env.PORT,
host: process.env.HOST,
})
]),
]);