This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update webpack and other dependencies
- Loading branch information
1 parent
46458b7
commit cbe1f0f
Showing
4 changed files
with
3,924 additions
and
1,962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/) | ||
] | ||
}; |
Oops, something went wrong.