1
1
mirror of https://github.com/primer/css.git synced 2024-12-20 04:32:21 +03:00
css/.storybook/webpack.config.js

45 lines
858 B
JavaScript
Raw Normal View History

2017-08-18 02:25:33 +03:00
const path = require("path");
const modulesPath = path.resolve(__dirname, "../modules")
2017-08-16 21:28:16 +03:00
2017-10-10 01:44:56 +03:00
module.exports = (config, env) => {
if (env === 'PRODUCTION') {
config.plugins = config.plugins
.filter(plugin => plugin.constructor.name !== 'UglifyJsPlugin')
}
config.module.rules.push(
{
test: /\.md$/,
use: "raw-loader",
},
{
test: /\.scss$/,
loaders: [
"style-loader",
"css-loader",
{
loader: "postcss-loader",
options: {
config: {
path: require.resolve("./postcss.config.js"),
2017-08-18 02:25:33 +03:00
},
},
2017-10-10 01:44:56 +03:00
},
{
loader: "sass-loader",
options: {
includePaths: [
modulesPath,
],
}
},
],
include: modulesPath,
}
)
return config
2017-08-16 21:28:16 +03:00
}