mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-03 06:13:35 +02:00
Compile one unminified file for devs
This commit is contained in:
parent
7207ee543f
commit
fb8d5dbe47
5198
assets/scripts/dist/choices.js
vendored
Normal file
5198
assets/scripts/dist/choices.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
assets/scripts/dist/choices.js.map
vendored
Normal file
1
assets/scripts/dist/choices.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -2,30 +2,20 @@ var path = require('path');
|
|||
var package = require('./package.json');
|
||||
var webpack = require('webpack');
|
||||
var wrapperPlugin = require('wrapper-webpack-plugin');
|
||||
var banner = `/*! ${ package.name } v${ package.version } | (c) ${ new Date().getFullYear() } ${ package.author } | ${ package.homepage } */ \n`
|
||||
var banner = `/*! ${ package.name } v${ package.version } | (c) ${ new Date().getFullYear() } ${ package.author } | ${ package.homepage } */ \n`;
|
||||
var minimize = process.argv.indexOf('--minimize') !== -1;
|
||||
|
||||
module.exports = {
|
||||
var config = {
|
||||
devtool: 'cheap-module-source-map',
|
||||
entry: [
|
||||
'./assets/scripts/src/choices'
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, '/assets/scripts/dist'),
|
||||
filename: 'choices.min.js',
|
||||
filename: minimize ? 'choices.min.js' : 'choices.js',
|
||||
publicPath: '/assets/scripts/dist/'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
sourceMap: false,
|
||||
mangle: true,
|
||||
output: {
|
||||
comments: false
|
||||
},
|
||||
compress: {
|
||||
warnings: false,
|
||||
screw_ie8: true
|
||||
}
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
// This has effect on the react lib size
|
||||
|
@ -44,4 +34,20 @@ module.exports = {
|
|||
include: path.join(__dirname, 'assets/scripts/src')
|
||||
}]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
if (minimize) {
|
||||
config.plugins.unshift(new webpack.optimize.UglifyJsPlugin({
|
||||
sourceMap: false,
|
||||
mangle: true,
|
||||
output: {
|
||||
comments: false
|
||||
},
|
||||
compress: {
|
||||
warnings: false,
|
||||
screw_ie8: true
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
module.exports = config;
|
Loading…
Reference in a new issue