12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- process.env.NODE_CONFIG_DIR = `${__dirname}/dist/config/`;
- const config = require("config");
- const VueLoaderPlugin = require("vue-loader/lib/plugin");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- module.exports = {
- entry: "./main.js",
- mode: "development",
- devtool: "inline-source-map",
- output: {
- path: `${__dirname}/dist/build/`,
- filename: "[name].[hash].js",
- publicPath: "/"
- },
- plugins: [
- new VueLoaderPlugin(),
- new HtmlWebpackPlugin({
- hash: true,
- template: "dist/index.tpl.html",
- inject: "body",
- filename: "index.html"
- })
- ],
- module: {
- rules: [
- {
- test: /\.vue$/,
- loader: "vue-loader",
- exclude: /node_modules/
- },
- {
- test: /\.js$/,
- loader: "babel-loader",
- exclude: /node_modules/
- },
- {
- test: /\.scss$/,
- exclude: /node_modules/,
- use: ["vue-style-loader", "css-loader", "sass-loader"]
- }
- ]
- },
- resolve: {
- alias: {
- vue: "vue/dist/vue.js",
- styles: "styles"
- }
- },
- devServer: {
- static: {
- directory: "./dist/",
- watch: true
- },
- client: {
- webSocketURL: config.get("webSocketURL")
- },
- hot: true,
- historyApiFallback: true,
- port: config.get("frontendPort"),
- host: "0.0.0.0",
- allowedHosts: "all"
- }
- };
|