Skip to content

Instantly share code, notes, and snippets.

@rpf5573
Last active May 1, 2019 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rpf5573/ab721375d99f2f8433edbf63da324edd to your computer and use it in GitHub Desktop.
Save rpf5573/ab721375d99f2f8433edbf63da324edd to your computer and use it in GitHub Desktop.
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