mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
Use webpack-merge.
Move html export config to own file. Delete unnecessary config options. Use cheap source maps. Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
9a2dcd40d3
commit
9f92bba036
5 changed files with 59 additions and 111 deletions
|
@ -1,41 +1,14 @@
|
|||
var baseConfig = require('./webpack.common')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
var path = require('path')
|
||||
const common = require('./webpack.common.js')
|
||||
const htmlexport = require('./webpack.htmlexport')
|
||||
const merge = require('webpack-merge')
|
||||
|
||||
module.exports = [Object.assign({}, baseConfig, {
|
||||
plugins: baseConfig.plugins.concat([
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css'
|
||||
})
|
||||
|
||||
]),
|
||||
devtool: 'source-map'
|
||||
}), {
|
||||
devtool: 'source-map',
|
||||
entry: {
|
||||
htmlExport: path.join(__dirname, 'public/js/htmlExport.js')
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader']
|
||||
}, {
|
||||
test: /\.scss$/,
|
||||
use: ['style-loader', 'sass-loader']
|
||||
}, {
|
||||
test: /\.less$/,
|
||||
use: ['style-loader', 'less-loader']
|
||||
}]
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, 'public/build'),
|
||||
publicPath: '/build/',
|
||||
filename: '[name].js'
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: 'html.min.css'
|
||||
})
|
||||
]
|
||||
}]
|
||||
module.exports = [
|
||||
// merge common config
|
||||
merge(common, {
|
||||
mode: 'development',
|
||||
devtool: 'cheap-module-eval-source-map'
|
||||
}),
|
||||
merge(htmlexport, {
|
||||
mode: 'development',
|
||||
devtool: 'cheap-module-eval-source-map'
|
||||
})]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue