mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-18 20:59:42 +02:00
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
This commit is contained in:
parent
3762ea3791
commit
248558a11f
27 changed files with 3003 additions and 219 deletions
60
webpack.config.js
Normal file
60
webpack.config.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
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
|
||||
}
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue