-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
55 lines (49 loc) · 1.23 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const ESLintPlugin = require('eslint-webpack-plugin');
const path = require('path');
const pack = require('./package.json');
let plugins = [];
let isProd = process.env.NODE_ENV == 'production';
let banner = `Akili is a javascript framework\n
const Akili = makeItEasy(js + html);\n
@version ${pack.version}
@author Alexandr Balasyan <[email protected]>
{@link http://akilijs.com}
{@link https://github.com/ortexx/akili}`;
plugins.push(new webpack.BannerPlugin({
banner: banner.trim()
}));
plugins.push(new ESLintPlugin());
let config = {
mode: isProd? 'production': 'development',
performance: { hints: false },
watch: !isProd,
devtool: isProd? false: "inline-source-map",
entry: "./src/akili.js",
output: {
path: path.join(__dirname, "/dist"),
filename: "akili.js",
library: 'Akili',
libraryExport: "default",
libraryTarget: 'umd'
},
optimization: {
minimizer: [
new TerserPlugin({
extractComments: false
})
]
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
},
plugins
};
module.exports = config;