1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-19 05:09:41 +02:00
codex.docs/webpack.config.js

61 lines
1.2 KiB
JavaScript
Raw Normal View History

const ExtractTextPlugin = require('extract-text-webpack-plugin');
/**
* Options for the Babel
*/
const babelLoader = {
loader: 'babel-loader',
options: {
cacheDirectory: '.cache/babel-loader',
presets: [
'env'
],
plugins: [
/**
* Dont need to use «.default» after «export default Class Ui {}»
* @see {@link https://github.com/59naga/babel-plugin-add-module-exports}
*/
// 'add-module-exports',
]
}
};
module.exports = (env) => {
return {
module: {
rules: [
{
test: /\.p?css$/,
use: ExtractTextPlugin.extract([
{
loader: 'css-loader',
options: {
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
config: {
path: './src/frontend/'
}
}
}
])
}, {
test: /\.js$/,
use: [
babelLoader
]
}
]
},
plugins: [
new ExtractTextPlugin('bundle.css')
],
optimization: {
minimize: true
}
};
};