-
-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update UglifyJSPlugin transformation #401
Changes from all commits
12613d6
1bbcc01
ebb4fa5
8b6522e
74034bf
5dded3f
f8c06c8
c4a05a3
afe9c9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,118 @@ | |
|
||
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-0" data 1`] = ` | ||
"module.exports = { | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
sourceMap: true | ||
}) | ||
] | ||
optimization: { | ||
minimize: true | ||
} | ||
} | ||
" | ||
`; | ||
|
||
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-1" data 1`] = ` | ||
"module.exports = { | ||
"const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
module.exports = { | ||
devtool: \\"source-map\\", | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
sourceMap: true | ||
}) | ||
] | ||
optimization: { | ||
minimize: true, | ||
|
||
minimizer: [new UglifyJsPlugin({ | ||
sourceMap: true, | ||
compress: {} | ||
})] | ||
} | ||
} | ||
" | ||
`; | ||
|
||
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-2" data 1`] = ` | ||
"const Uglify = require('uglifyjs-webpack-plugin'); | ||
module.exports = { | ||
devtool: \\"source-map\\", | ||
optimization: { | ||
minimize: true, | ||
|
||
minimizer: [new Uglify({ | ||
sourceMap: true, | ||
compress: {} | ||
})] | ||
} | ||
} | ||
" | ||
`; | ||
|
||
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-3" data 1`] = ` | ||
"module.exports = { | ||
devtool: \\"cheap-source-map\\", | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: {}, | ||
devtool: 'eval', | ||
|
||
entry: [ | ||
'./src/index' | ||
], | ||
|
||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'index.js' | ||
}, | ||
|
||
module: { | ||
loaders: [{ | ||
test: /.js$/, | ||
loaders: ['babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
}, | ||
|
||
resolve: { | ||
root: path.resolve('/src'), | ||
modules: ['node_modules'] | ||
}, | ||
|
||
plugins: [new webpack.optimize.OccurrenceOrderPlugin()], | ||
debug: true, | ||
|
||
optimization: { | ||
minimize: true | ||
} | ||
}; | ||
" | ||
`; | ||
|
||
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-4" data 1`] = ` | ||
"const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
module.exports = { | ||
devtool: 'eval', | ||
|
||
entry: [ | ||
'./src/index' | ||
], | ||
|
||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'index.js' | ||
}, | ||
|
||
module: { | ||
loaders: [{ | ||
test: /.js$/, | ||
loaders: ['babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
}, | ||
|
||
resolve: { | ||
root: path.resolve('/src'), | ||
modules: ['node_modules'] | ||
}, | ||
|
||
plugins: [new webpack.optimize.OccurrenceOrderPlugin()], | ||
debug: true, | ||
|
||
optimization: { | ||
minimize: true, | ||
|
||
minimizer: [new UglifyJsPlugin({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this correct? Could you link me to the docs on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oki, good stuff |
||
sourceMap: true | ||
}) | ||
] | ||
} | ||
})] | ||
} | ||
}; | ||
" | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
|
||
module.exports = { | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin() | ||
new UglifyJsPlugin() | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
module.exports = { | ||
devtool: "source-map", | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({}) | ||
new UglifyJsPlugin({ | ||
sourceMap: true, | ||
compress: {} | ||
}) | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports = { | ||
devtool: 'eval', | ||
entry: [ | ||
'./src/index' | ||
], | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'index.js' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /.js$/, | ||
loaders: ['babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
}, | ||
resolve: { | ||
root: path.resolve('/src'), | ||
modules: ['node_modules'] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin(), | ||
new webpack.optimize.OccurrenceOrderPlugin() | ||
], | ||
debug: true | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
devtool: 'eval', | ||
entry: [ | ||
'./src/index' | ||
], | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'index.js' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /.js$/, | ||
loaders: ['babel'], | ||
include: path.join(__dirname, 'src') | ||
}] | ||
}, | ||
resolve: { | ||
root: path.resolve('/src'), | ||
modules: ['node_modules'] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
sourceMap: true | ||
}), | ||
new webpack.optimize.OccurrenceOrderPlugin() | ||
], | ||
debug: true | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a problem here, something i left behind... i'm fixing it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.