Skip to content

Commit

Permalink
fix(webpack): fix syntax error
Browse files Browse the repository at this point in the history
ERROR in server.js from UglifyJs
SyntaxError: Unexpected token: operator (>)
  • Loading branch information
kiki-le-singe committed Jan 12, 2017
1 parent 7979583 commit da61df6
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions webpack/server.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path'
import webpack from 'webpack'
import nodeExternals from 'webpack-node-externals'
import _debug from 'debug'
Expand All @@ -6,6 +7,7 @@ import projectConfig, { paths } from '../config'

const debug = _debug('app:webpack:config:server')
const srcDir = paths('src')
const projectConfigDir = paths('projectConfig')
const {
__DEV__,
__PROD__
Expand Down Expand Up @@ -45,12 +47,12 @@ const config = {
test: /\.js[x]?$/,
enforce: 'pre',
loader: 'eslint-loader',
include: [srcDir],
include: [srcDir, projectConfigDir],
},
{
test: /\.js[x]?$/,
loader: 'babel-loader',
include: [srcDir],
include: [srcDir, projectConfigDir],
options: {
cacheDirectory: true,
}
Expand All @@ -75,6 +77,29 @@ const config = {
],
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
screw_ie8: true,
sequences: true,
dead_code: true,
drop_debugger: true,
comparisons: true,
conditionals: true,
evaluate: true,
booleans: true,
loops: true,
unused: true,
hoist_funs: true,
if_return: true,
join_vars: true,
cascade: true,
},
output: {
comments: false
},
sourceMap: true
}),
// source-map-support: Useful to add source map support to node.js
new webpack.BannerPlugin({
banner: 'require("source-map-support").install();',
Expand Down

0 comments on commit da61df6

Please sign in to comment.