Skip to content

Commit

Permalink
Matched row order. Fixed production compile bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stardog committed Nov 14, 2017
1 parent 2293593 commit 8547db3
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 47 deletions.
28 changes: 14 additions & 14 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,55 @@ module.exports = {
entry: setup.entry,
output: {
path: setup.path.join(setup.APP_DIR, 'dev'),
filename: '[name].js',
filename: '[name].js'
},
externals: {
$: 'jQuery',
EntryForm: 'EntryForm',
EntryForm: 'EntryForm'
},
resolve: {
extensions: [
'.js', '.jsx',
],
alias: {
'jquery-ui/widget': 'blueimp-file-upload/js/vendor/jquery.ui.widget.js'
}
},
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({name: 'vendor', filename: 'vendor.js',}),
new webpack.ProvidePlugin({
EntryForm: 'EntryForm',
}),
new webpack.optimize.CommonsChunkPlugin(
{name: 'vendor', filename: 'vendor.js'}
),
new webpack.ProvidePlugin({EntryForm: 'EntryForm'}),
],
module: {
rules: [
{
test: require.resolve('blueimp-file-upload'),
loader: 'imports-loader?define=>false',
loader: 'imports-loader?define=>false'
}, {
test: require.resolve('medium-editor-insert-plugin'),
loader: 'imports-loader?define=>false',
loader: 'imports-loader?define=>false'
}, {
test: /\.jsx?$/,
enforce: 'pre',
loader: 'jshint-loader',
exclude: '/node_modules/',
include: setup.APP_DIR + '/dev',
include: setup.APP_DIR + '/dev'
}, {
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000',
loader: 'url-loader?limit=100000'
}, {
test: /\.jsx?/,
include: setup.APP_DIR,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react',]
},
}
}, {
test: /\.css$/,
loader: 'style-loader!css-loader',
loader: 'style-loader!css-loader'
},
]
},
devtool: 'source-map',
devtool: 'source-map'
}
70 changes: 37 additions & 33 deletions webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,55 @@ module.exports = {
chunkFilename: '[name].[chunkhash:8].chunk.js',
},
externals: {
jquery: 'jQuery',
$: 'jQuery',
EntryForm: 'EntryForm',
},
resolve: {
extensions: ['.js', '.jsx',],
extensions: [
'.js', '.jsx',
],
alias: {
'jquery-ui/widget': 'blueimp-file-upload/js/vendor/jquery.ui.widget.js',
'jquery-ui/widget': 'blueimp-file-upload/js/vendor/jquery.ui.widget.js'
},
},
plugins: [
new webpack.optimize.CommonsChunkPlugin(
{name: 'vendor', filename: 'vendor.[chunkhash:8].js'}
),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),

new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
warnings: false
},
mangle: {
screw_ie8: true
},
output: {
comments: false,
screw_ie8: true
}
}),

new AssetsPlugin({filename: 'assets.json', prettyPrint: true}),
],
module: {
rules: [
{
test: require.resolve('blueimp-file-upload'),
loader: 'imports-loader?define=>false'
},
{
}, {
test: require.resolve('medium-editor-insert-plugin'),
loader: 'imports-loader?define=>false'
},
{
}, {
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000'
}, {
test: /\.jsx?/,
include: setup.APP_DIR,
loader: 'babel-loader',
Expand All @@ -44,35 +73,10 @@ module.exports = {
],
exclude: /node_modules/,
loader: WebpackStripLoader.loader('console.log')
}, {
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000'
}, {
test: /\.css$/,
loader: 'style-loader!css-loader'
},
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({name: 'vendor', filename: 'vendor.[chunkhash:8].js'}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
warnings: false
},
mangle: {
screw_ie8: true
},
output: {
comments: false,
screw_ie8: true
}
}),
new AssetsPlugin({filename: 'assets.json', prettyPrint: true}),
]
}
}

0 comments on commit 8547db3

Please sign in to comment.