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
Peter Savchenko 248558a11f
Frontent build system is ready (#3)
* Frontent build system is ready

* Set up linter for frontend part

* move code to /src

* update db

* upd test

* remove db

* ignore .db
2018-09-07 19:24:09 +03:00

60 lines
1.2 KiB
JavaScript

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
}
};
};