Fix JS bundle banner for production
This commit is contained in:
@@ -7,14 +7,7 @@ const year = new Date().getFullYear();
|
|||||||
|
|
||||||
const production = process.env.NODE_ENV === 'production';
|
const production = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
module.exports = {
|
const banner = `/**!
|
||||||
input: resolve(__dirname, 'js/index.js'),
|
|
||||||
output: {
|
|
||||||
file: resolve(__dirname, 'theme/bundle.js'),
|
|
||||||
format: 'umd',
|
|
||||||
name: 'windy',
|
|
||||||
sourcemap: !production && 'inline',
|
|
||||||
banner: `/**!
|
|
||||||
* Theme Name: WindyCOYS
|
* Theme Name: WindyCOYS
|
||||||
* Theme URI: https://github.com/danhead/windycoys/
|
* Theme URI: https://github.com/danhead/windycoys/
|
||||||
* Author: ${pkg.author}
|
* Author: ${pkg.author}
|
||||||
@@ -24,12 +17,25 @@ module.exports = {
|
|||||||
* Copyright: (c) ${year} ${pkg.author}
|
* Copyright: (c) ${year} ${pkg.author}
|
||||||
* License: MIT
|
* License: MIT
|
||||||
* License URI: https://choosealicense.com/licenses/mit/
|
* License URI: https://choosealicense.com/licenses/mit/
|
||||||
*/`,
|
*/`;
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
input: resolve(__dirname, 'js/index.js'),
|
||||||
|
output: {
|
||||||
|
file: resolve(__dirname, 'theme/bundle.js'),
|
||||||
|
format: 'umd',
|
||||||
|
name: 'windy',
|
||||||
|
sourcemap: !production && 'inline',
|
||||||
|
banner,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
babel({
|
babel({
|
||||||
exclude: 'node_modules/**',
|
exclude: 'node_modules/**',
|
||||||
}),
|
}),
|
||||||
production && uglify(),
|
production && uglify({
|
||||||
|
output: {
|
||||||
|
preamble: banner,
|
||||||
|
},
|
||||||
|
}),
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user