1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-18 20:59:42 +02:00
codex.docs/webpack.config.js
Peter Savchenko e7e64cea3e
Integrate CodeXEditor: dynamic import added (#5)
* Main elements created

* Add Editor to the writing page
2018-09-19 01:47:32 +03:00

58 lines
1.1 KiB
JavaScript

const ExtractTextPlugin = require('extract-text-webpack-plugin');
/**
* Options for the Babel
*/
const babelLoader = {
loader: 'babel-loader',
options: {
cacheDirectory: '.cache/babel-loader',
presets: [
'@babel/preset-env',
],
plugins: [
'babel-plugin-transform-es2015-modules-commonjs',
'@babel/plugin-syntax-dynamic-import'
]
}
};
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$/,
exclude: /(node_modules|bower_components)/,
use: [
babelLoader
]
}
]
},
plugins: [
new ExtractTextPlugin('bundle.css')
],
optimization: {
minimize: false
}
};
};