webpack.config.js 1.1 KB
Newer Older
璃白.'s avatar
璃白. 已提交
1 2 3 4
const path = require("path");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
module.exports = {
  entry: path.resolve(__dirname, "./src/main.js"),
璃白.'s avatar
璃白. 已提交
5 6 7
  // experiments: {
  //   outputModule: true
  // },
璃白.'s avatar
璃白. 已提交
8
  output: {
璃白.'s avatar
璃白. 已提交
9
    filename: "markdown-editor.js",
璃白.'s avatar
璃白. 已提交
10
    path: path.resolve(__dirname, "public"),
璃白.'s avatar
璃白. 已提交
11 12 13
    // library: {
    //   type: "module"
    // }
璃白.'s avatar
璃白. 已提交
14 15
  },
  devServer: {
璃白.'s avatar
璃白. 已提交
16
    contentBase: path.resolve(__dirname, "public"),
璃白.'s avatar
璃白. 已提交
17
    host: "127.0.0.1",
璃白.'s avatar
璃白. 已提交
18
    port: "80",
璃白.'s avatar
璃白. 已提交
19 20
    // port: 443,
    // https: true,
璃白.'s avatar
璃白. 已提交
21 22 23
    open: true
  },
  resolve: {
璃白.'s avatar
璃白. 已提交
24
    extensions: [".js", ".ts", ".vue", ".json"],
璃白.'s avatar
璃白. 已提交
25 26 27 28 29 30 31 32 33 34 35
    alias: {
      "@": path.resolve(__dirname, "./src")
    }
  },
  module: {
    rules: [
      {
        test: /\.vue$/,
        loader: "vue-loader"
      },
      {
璃白.'s avatar
璃白. 已提交
36
        test: /\.(less|css)$/i,
璃白.'s avatar
璃白. 已提交
37 38 39 40
        use: ["style-loader", "css-loader", "less-loader"]
      },

      {
璃白.'s avatar
璃白. 已提交
41
        test: /\.(ttf|woff|png|svg)$/,
璃白.'s avatar
璃白. 已提交
42
        loader: "url-loader"
璃白.'s avatar
璃白. 已提交
43 44 45 46 47 48 49 50
      },
      {
        test: /\.tsx?$/,
        loader: "ts-loader",
        exclude: /node_modules/,
        options: {
          appendTsSuffixTo: [/\.vue$/]
        }
璃白.'s avatar
璃白. 已提交
51 52 53 54 55
      }
    ]
  },
  plugins: [new VueLoaderPlugin()]
};