2018-02-15 11:16:12 +00:00
|
|
|
const helpers = require('./helpers');
|
2018-12-20 08:56:59 +00:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
2018-02-15 11:16:12 +00:00
|
|
|
|
|
|
|
const prepareOutputConfig = (outputPath, jsFilenamePattern = '[name]', cssFilenamePattern = '[name]') => ({
|
|
|
|
output: {
|
|
|
|
filename: `${jsFilenamePattern}.js`,
|
|
|
|
path: helpers.root(outputPath),
|
2018-02-15 12:30:54 +00:00
|
|
|
publicPath: './'
|
2018-02-15 11:16:12 +00:00
|
|
|
},
|
2018-12-20 08:56:59 +00:00
|
|
|
plugins: [new MiniCssExtractPlugin({ filename: `${cssFilenamePattern}.css` })]
|
2018-02-15 11:16:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = prepareOutputConfig;
|