mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-19 05:09:41 +02:00
* Frontent build system is ready * Set up linter for frontend part * move code to /src * update db * upd test * remove db * ignore .db
60 lines
1.2 KiB
JavaScript
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
|
|
}
|
|
};
|
|
};
|