-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
56 lines (53 loc) · 1.51 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
56
const path = require('path');
const webpack = require('webpack');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
require('graceful-fs').gracefulify(require('fs'));
let ASSET_PATH = '';
module.exports = env => {
let DOMAIN = JSON.stringify('http://localhost/lugochat');
if (env.NODE_ENV === 'acdol') {
DOMAIN = JSON.stringify('https://buscademoteis.com.br/painel');
ASSET_PATH = '';
}
return {
entry: {
main: './view/assets/js/init.js',
},
output: {
filename: "[name].[contenthash].js",
path: path.resolve(__dirname, 'view/assets/dist'),
publicPath: ASSET_PATH + '/view/assets/dist/',
},
plugins: [
new webpack.DefinePlugin({
DOMAIN,
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
}),
new WebpackManifestPlugin(),
],
devtool: false,
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
]
},
resolve: {
extensions: ['.js'],
},
optimization: {
minimize: true,
},
}
}