12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- const VueLoaderPlugin = require("vue-loader/lib/plugin");
- const WebpackMd5Hash = require("webpack-md5-hash");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- module.exports = {
- entry: "./main.js",
- output: {
- path: `${__dirname}/dist/build/`,
- filename: "[name].[hash].js"
- },
- plugins: [
- new VueLoaderPlugin(),
- new WebpackMd5Hash(),
- new HtmlWebpackPlugin({
- hash: true,
- template: "dist/index.tpl.html",
- inject: "body",
- filename: "index.html"
- })
- ],
- module: {
- rules: [
- {
- enforce: "pre",
- test: /\.vue$/,
- loader: "eslint-loader",
- exclude: /node_modules/
- },
- {
- test: /\.vue$/,
- loader: "vue-loader",
- exclude: /node_modules/
- },
- {
- enforce: "pre",
- test: /\.js$/,
- loader: "eslint-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"]
- }
- ]
- },
- externals: {
- moment: "moment"
- }
- };
|