Eli Perelman
8 years ago
committed by
GitHub
9 changed files with 161 additions and 24 deletions
@ -1,6 +1,8 @@ |
|||
module.exports = ({ config }) => config.module |
|||
const merge = require('deepmerge'); |
|||
|
|||
module.exports = ({ config }, options) => config.module |
|||
.rule('html') |
|||
.test(/\.html$/) |
|||
.use('file') |
|||
.loader(require.resolve('file-loader')) |
|||
.options({ name: '[name].[ext]' }); |
|||
.options(merge({ name: '[name].[ext]' }, options)); |
|||
|
@ -1,3 +1,6 @@ |
|||
const BabiliPlugin = require('babili-webpack-plugin'); |
|||
|
|||
module.exports = ({ config }) => config.plugin('minify').use(BabiliPlugin); |
|||
module.exports = ({ config }, options) => config |
|||
.plugin('minify') |
|||
.use(BabiliPlugin) |
|||
.when(options, plugin => plugin.tap(() => [options])); |
|||
|
@ -1,8 +1,10 @@ |
|||
module.exports = ({ config }) => config.module |
|||
module.exports = ({ config }, options) => config.module |
|||
.rule('style') |
|||
.test(/\.css$/) |
|||
.use('style') |
|||
.loader(require.resolve('style-loader')) |
|||
.end() |
|||
.use('css') |
|||
.loader(require.resolve('css-loader')); |
|||
.test(/\.css$/) |
|||
.use('style') |
|||
.loader(require.resolve('style-loader')) |
|||
.when(options.style, use => use.options(options.style)) |
|||
.end() |
|||
.use('css') |
|||
.loader(require.resolve('css-loader')) |
|||
.when(options.css, use => use.options(options.css)); |
|||
|
Loading…
Reference in new issue