Last active
May 1, 2019 06:41
-
-
Save rpf5573/ab721375d99f2f8433edbf63da324edd to your computer and use it in GitHub Desktop.
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
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const join = require('path').join; | |
module.exports = { | |
name: 'user', | |
entry: [join(__dirname, '/index.js')], | |
devtool: 'source-map', | |
output: { | |
filename: "main.js", | |
path: join(__dirname, '../../../public/user/'), | |
publicPath: '/user' | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: { | |
loader: "babel-loader" // 알아서 babelrc.js 파일을 참고한다 | |
} | |
}, | |
{ | |
test: /\.(scss|css)$/, | |
use: [ | |
MiniCssExtractPlugin.loader, | |
{ | |
loader: "css-loader" | |
}, | |
{ | |
// auto prefix 적용 | |
loader: 'postcss-loader', | |
options: { | |
plugins: () => [require('autoprefixer')({ | |
'browsers': ['> 10%', 'last 2 versions'] | |
})], | |
} | |
}, | |
{ | |
loader: 'sass-loader', | |
} | |
] | |
} | |
] | |
}, | |
plugins: [ | |
new MiniCssExtractPlugin({ | |
// Options similar to the same options in webpackOptions.output | |
// both options are optional | |
filename: "style.css", | |
path: join(__dirname, '../../../public/user/'), | |
chunkFilename: "[id].css" | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment