Skip to content

Commit

Permalink
Updated webpack & babel to latest (#371)
Browse files Browse the repository at this point in the history
* Updated webpack & bable to latest

* Added missing packages
  • Loading branch information
euvl authored Dec 6, 2018
1 parent 3c4b4fb commit 07822e0
Show file tree
Hide file tree
Showing 27 changed files with 14,169 additions and 27,762 deletions.
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function (babel) {
babel.cache(true);

return {
"presets": ["@babel/preset-env"],
"comments": false,
"plugins": [
"@babel/plugin-proposal-object-rest-spread"
]
}
}
36 changes: 23 additions & 13 deletions build/webpack.base.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
const path = require('path')
const webpack = require('webpack')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin")
const { VueLoaderPlugin } = require('vue-loader')

module.exports = {
mode: 'production',
entry: path.resolve(__dirname, '../src/index.js'),
output: {
library: 'vue-js-modal',
libraryTarget: 'umd',
path: path.resolve(__dirname, '../dist'),
publicPath: '/dist/',
library: 'vue-js-modal',
libraryTarget: 'umd'
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true
}),
new OptimizeCSSAssetsPlugin({})
]
},
module: {
rules: [
Expand All @@ -20,18 +31,17 @@ module.exports = {
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
}
}),
new UglifyJSPlugin({
mangle: false,
beautify: true
})
new VueLoaderPlugin()
]
}
44 changes: 23 additions & 21 deletions build/webpack.ssr-no-css.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const VueLoaderPlugin = require('vue-loader/lib/plugin')

module.exports = {
mode: 'production',
target: 'node',
entry: path.resolve(__dirname, '../src/index.js'),
output: {
Expand All @@ -13,37 +14,38 @@ module.exports = {
libraryTarget: 'umd',
filename: 'ssr.nocss.js'
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true
})
]
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
css: ExtractTextPlugin.extract({
use: 'css-loader',
fallback: 'vue-style-loader'
})
}
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader'
]
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
new UglifyJSPlugin({
mangle: false,
beautify: true
}),
new ExtractTextPlugin('styles.css')
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: "styles.css",
})
]
}
Loading

0 comments on commit 07822e0

Please sign in to comment.