mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 10:42:45 +03:00
cc4eda6478
refs https://github.com/TryGhost/Team/issues/1664 - overrides webpack config to generate single script for publishing - adds custom scripts for dev and production mode
35 lines
837 B
JavaScript
35 lines
837 B
JavaScript
const path = require('path');
|
|
const glob = require('glob');
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
|
module.exports = {
|
|
mode: 'production',
|
|
entry: {
|
|
'bundle.js': glob.sync('build/static/?(js|css)/main.*.?(js|css)').map(f => path.resolve(__dirname, f))
|
|
},
|
|
output: {
|
|
filename: 'comments-ui.min.js',
|
|
path: __dirname + '/umd'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader']
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new CopyPlugin({
|
|
patterns: [
|
|
{from: './build/static/js/main.js.map', to: './umd/comments-ui.min.js.map'}
|
|
]
|
|
})
|
|
],
|
|
performance: {
|
|
hints: false,
|
|
maxEntrypointSize: 560,
|
|
maxAssetSize: 5600
|
|
}
|
|
};
|