[mod] make production webapp work as well
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
const webpack = require("webpack");
|
||||
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
||||
|
||||
let __API__ = "'http://localhost:10501'"
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
__API__ = "'/'"
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, './src/webapp/'),
|
||||
entry: './index.js',
|
||||
@@ -16,7 +24,10 @@ module.exports = {
|
||||
title: 'Output Management',
|
||||
template: 'index.html'
|
||||
}),
|
||||
new VueLoaderPlugin()
|
||||
new VueLoaderPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
__API__
|
||||
})
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
|
||||
Reference in New Issue
Block a user