Answer the question
In order to leave comments, you need to log in
How not to transform entry file in Webpack?
There is a config.
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const {resolve, isLocal, modules} = require("./utils");
const alias = require("./alias");
const webpack = require("webpack");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
entry: {
app: "./src/main.js",
links: "./statics/links.js"
},
output: {
path: resolve("../dist"),
filename: "[name].js",
chunkFilename: "[id].chunk.js",
publicPath: isLocal() ? "/" : "/lko-vue/"
},
resolve: {
extensions: [".js", ".jsx", ".vue", "json"],
alias
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: "babel-loader"
},
{
test: /\.vue$/,
loader: "vue-loader",
options: {
loaders: {
js: "babel-loader"
}
}
},
{
test: /\.scss$/,
use: modules.scss
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader"
]
}
]
},
plugins: [
new MiniCssExtractPlugin({filename: "[name].css"}),
new VueLoaderPlugin(),
new CleanWebpackPlugin(),
]
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question