123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- const path = require("path");
- const { VueLoaderPlugin } = require("vue-loader");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- module.exports = {
- entry: "./src/main.js",
- output: {
- path: `${__dirname}/dist/build/`,
- filename: "[name].[contenthash].js"
- },
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "./src/")
- },
- extensions: [".js", ".vue"]
- },
- plugins: [
- new VueLoaderPlugin(),
- 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"]
- }
- ]
- }
- };
|