Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Update webpack and other dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
microbouji committed Apr 30, 2020
1 parent 46458b7 commit cbe1f0f
Show file tree
Hide file tree
Showing 4 changed files with 3,924 additions and 1,962 deletions.
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@
"dependencies": {
"@webcomponents/webcomponentsjs": "git://github.com/webcomponents/webcomponentsjs.git#v1.0.0",
"markdown": "^0.5.0",
"navigo": "^4.7.1",
"whatwg-fetch": "^2.0.3"
"navigo": "^7.1.2",
"whatwg-fetch": "^3.0.0"
},
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.24.1",
"copy-webpack-plugin": "^4.0.1",
"html-webpack-plugin": "^2.28.0",
"path": "^0.12.7",
"uglify-es": "git://github.com/mishoo/UglifyJS2#harmony",
"uglifyjs-webpack-plugin": "^0.4.3",
"webpack": "^2.5.1",
"webpack-dev-server": "^2.4.5"
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"babel-loader": "^8.1.0",
"html-webpack-plugin": "^4.2.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
}
}
47 changes: 15 additions & 32 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
var webpack = require('webpack');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: './app/index.html',
filename: 'index.html',
inject: 'body',
});
var CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
entry: ['whatwg-fetch', './app/index.js'],
output: {
path: path.resolve('dist'),
filename: 'index_bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {plugins: ['transform-decorators-legacy']}
},
{test: /\.jsx$/, loader: 'babel-loader', exclude: /node_modules/}
]
},
plugins: [HtmlWebpackPluginConfig, new webpack.HotModuleReplacementPlugin(), new CopyWebpackPlugin([{
context: './app',
from: '**/*.html',
}]), new webpack.IgnorePlugin(/vertx/)],
devServer: {
hot: true,
contentBase: './',
historyApiFallback: true
}
mode: 'development',
entry: './app/index.js',
plugins: [
new HtmlWebpackPlugin({
template: './app/index.html'
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.IgnorePlugin(/vertx/)
],
devServer: {
hot: true,
contentBase: './',
historyApiFallback: true
}
};
64 changes: 31 additions & 33 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
devtool: 'source-map',
entry: ['whatwg-fetch', './app/index.js'],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new HtmlWebpackPlugin({
template: './app/index.html'
}),

new CopyWebpackPlugin([{
context: './app',
from: '**/*.html',
}]),
new webpack.IgnorePlugin(/vertx/)
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {plugins: ['transform-decorators-legacy']}
}
]
}
}
mode: 'production',
devtool: 'source-map',
entry: ['whatwg-fetch', './app/index.js'],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: './app/index.html'
}),
new webpack.IgnorePlugin(/vertx/)
]
};
Loading

0 comments on commit cbe1f0f

Please sign in to comment.