-
-
Notifications
You must be signed in to change notification settings - Fork 866
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(webpack): update webpack configs
- Loading branch information
1 parent
4b700cb
commit 6a0db0d
Showing
13 changed files
with
273 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
*.log | ||
npm-debug.log* | ||
dist | ||
node_modules | ||
node_modules | ||
.DS_Store |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Empty file.
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,7 +1,2 @@ | ||
'use strict'; | ||
|
||
if (module.hot) { | ||
module.hot.accept(); | ||
} | ||
|
||
import '../styles/index.scss'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'babel-polyfill'; |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use strict'; | ||
|
||
const Path = require('path'); | ||
const CleanWebpackPlugin = require('clean-webpack-plugin'); | ||
const CopyWebpackPlugin = require('copy-webpack-plugin'); | ||
const Webpack = require('webpack'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
const dest = Path.join(__dirname, '../dist'); | ||
|
||
module.exports = { | ||
entry: [ | ||
Path.resolve(__dirname, './polyfills'), | ||
Path.resolve(__dirname, '../src/scripts/index') | ||
], | ||
output: { | ||
path: dest, | ||
filename: 'bundle.[hash].js' | ||
}, | ||
plugins: [ | ||
new CleanWebpackPlugin([dest]), | ||
new CopyWebpackPlugin([ | ||
{ from: Path.resolve(__dirname, '../public'), to: 'public' } | ||
]), | ||
new HtmlWebpackPlugin({ | ||
template: Path.resolve(__dirname, '../src/index.html') | ||
}) | ||
], | ||
resolve: { | ||
alias: { | ||
'~': Path.resolve(__dirname, '../src') | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/, | ||
use: { | ||
loader: 'file-loader', | ||
options: { | ||
name: '[path][name].[ext]' | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}; |
Oops, something went wrong.