Skip to content

Commit

Permalink
Merge pull request #42 from ansidev/master
Browse files Browse the repository at this point in the history
Update dependencies and migrate config
  • Loading branch information
euvl authored Jan 4, 2019
2 parents 9a520f2 + 42238c1 commit 5f998cf
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 938 deletions.
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"presets": ["es2015", "stage-2"],
"presets": [
["@babel/env", { "modules": false }]
],
"comments": false
}
7 changes: 3 additions & 4 deletions demo/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"presets": [
["latest", {
"es2015": { "modules": false }
}]
]
["@babel/env", { "modules": false }]
],
"comments": false
}
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
height="20px"></iframe>
</div>
<div id="app"></div>
<script src="/dist/build.js"></script>
<script src="./dist/build.js"></script>
</body>
</html>
33 changes: 18 additions & 15 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
{
"name": "demo",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
"dev": "cross-env NODE_ENV=development webpack-dev-server --mode development --open --hot",
"build": "cross-env NODE_ENV=production webpack --mode production --progress --hide-modules"
},
"dependencies": {
"vue": "^2.0.0"
"vue": "^2.5.21"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-preset-latest": "^6.0.0",
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"node-sass": "^4.5.0",
"sass-loader": "^5.0.1",
"vue-loader": "^11.1.4",
"vue-template-compiler": "^2.2.1",
"webpack": "^2.2.0",
"webpack-dev-server": "^2.2.0"
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"babel-loader": "^8.0.4",
"cross-env": "^5.2.0",
"css-loader": "^2.1.0",
"file-loader": "^3.0.1",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"uglifyjs-webpack-plugin": "^2.1.1",
"vue-loader": "^15.4.2",
"vue-template-compiler": "^2.5.21",
"webpack": "^4.28.3",
"webpack-cli": "^3.2.0",
"webpack-dev-server": "^3.1.14"
}
}
33 changes: 25 additions & 8 deletions demo/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var path = require('path')
var webpack = require('webpack')
const path = require('path')
const webpack = require('webpack')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const UglifyJsPlugin = require("uglifyjs-webpack-plugin")

module.exports = {
entry: './src/main.js',
Expand All @@ -24,6 +26,10 @@ module.exports = {
// other vue-loader options go here
}
},
{
test: /\.scss$/,
loader: 'vue-style-loader!css-loader!sass-loader',
},
{
test: /\.js$/,
loader: 'babel-loader',
Expand All @@ -44,6 +50,23 @@ module.exports = {
'plugin': path.resolve(__dirname, "../dist/index.js")
}
},
plugins: [
new VueLoaderPlugin(),
],
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: true,
parallel: 4,
uglifyOptions: {
warnings: false,
compress: {
warnings: false
},
},
})
]
},
devServer: {
historyApiFallback: true,
noInfo: true
Expand All @@ -63,12 +86,6 @@ if (process.env.NODE_ENV === 'production') {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
Expand Down
Loading

0 comments on commit 5f998cf

Please sign in to comment.