epsilon_webui/webpack.common.js

79 lines
2.1 KiB
JavaScript
Raw Permalink Normal View History

2022-01-15 15:52:21 +00:00
const path = require("path");
const { VueLoaderPlugin } = require("vue-loader");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: path.resolve("./src/main.js"),
output: {
filename: "[name].bundle.js",
path: path.resolve("./dist"),
},
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader",
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.s[ac]ss$/i,
use: [
"vue-style-loader",
"css-loader",
{
loader: "sass-loader",
options: {
sassOptions: {
}
}
},
],
},
{
test: /\.js$/,
exclude: file => (
/node_modules/.test(file) &&
!/\.vue\.js/.test(file)
),
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
}
}
},
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
}
}
},
2022-01-15 15:52:21 +00:00
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: "asset/resource",
},
2022-01-17 08:46:31 +00:00
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: "asset/resource",
2022-01-17 08:46:31 +00:00
}
]
2022-01-15 15:52:21 +00:00
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src/")
},
},
plugins: [
new HtmlWebpackPlugin({
title: "Reslate SE"
}),
2022-01-15 15:52:21 +00:00
new VueLoaderPlugin(),
]
};