Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d4c30f
commit 24a9fb3
Showing
11 changed files
with
907 additions
and
39 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,5 @@ | ||
const prefixer = require('autoprefixer'); | ||
|
||
module.exports = { | ||
plugins: [prefixer], | ||
}; |
Empty file.
Empty file.
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
File renamed without changes.
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
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,83 @@ | ||
const path = require('path'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
const DIST_DIR = path.join(__dirname, 'dist'); | ||
const SRC_DIR = path.join(__dirname, 'src'); | ||
|
||
module.exports = { | ||
mode: 'production', | ||
context: SRC_DIR, | ||
entry: { | ||
app: './index.js', | ||
vendor: [ | ||
'@material-ui/core', | ||
], | ||
}, | ||
output: { | ||
filename: 'js/bundle.[hash].js', | ||
path: DIST_DIR, | ||
publicPath: '/', | ||
}, | ||
devtool: 'source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|jsx)$/, | ||
exclude: /node_modules/, | ||
use: ['babel-loader'], | ||
}, | ||
{ | ||
test: /\.(s?css)$/, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: [ | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
camelCase: true, | ||
sourceMap: true, | ||
}, | ||
}, | ||
{ | ||
loader: 'postcss-loader', | ||
options: { | ||
config: { | ||
ctx: { | ||
autoprefixer: { | ||
browsers: 'last 2 versions', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
loader: 'sass-loader', | ||
}, | ||
], | ||
}), | ||
}, | ||
], | ||
}, | ||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
vendor: { | ||
chunks: 'initial', | ||
test: 'vendor', | ||
name: 'vendor', | ||
enforce: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: 'public/index.html', | ||
}), | ||
new ExtractTextPlugin({ | ||
filename: 'styles/styles.[hash].css', | ||
allChunks: true, | ||
}), | ||
], | ||
}; |