vue2 scss编译报错 #2181
vue2 scss编译报错
#2181
Replies: 2 comments 4 replies
-
config 配置如下 import { defineConfig } from "@rsbuild/core";
import { pluginVue2 } from "@rsbuild/plugin-vue2";
import { pluginNodePolyfill } from "@rsbuild/plugin-node-polyfill";
const path = require("path");
export default defineConfig({
plugins: [pluginNodePolyfill(), pluginVue2()],
source: {
// 指定入口文件
entry: {
index: "./src/main.js",
},
alias: {
"@": path.resolve(__dirname, "src"),
},
extensions: [".js", ".json", ".wasm", ".vue", ".jsx", ".tsx"],
},
dev: {
progressBar: true,
// writeToDisk: true, 不占用内存,写入到磁盘
},
html: {
template: "./public/index.html",
},
tools: {
sass: {
},
less: {
// additionalData: `@import "${path.resolve(__dirname, 'src')}/components/index.less";`,
// lessOptions: {
// relativeUrls: true,
// rewriteUrls: 'local',
// modifyVars: {
// '@primary-color': '#077BFC',
// '@btn-primary-bg': '#077BFC',
// },
// javascriptEnabled: true,
// },
},
},
output: {
distPath: {
root: "screen",
js: "resource/js",
},
assetPrefix: "./",
clean: true,
filename: "js/[name].js",
cssFilename: "css/[name].css",
assetModuleFilename: "assets/[hash][ext]",
},
module: {
rules: [
// {
// test: /\.less$/,
// loader: "less-loader",
// type: "css",
// },
// {
// test: /\.scss$/,
// loader: 'sass-loader',
// type: 'css',
// exclude: /node_modules/,
// },
],
},
server: {
port: 8000,
headers: {
"Access-Control-Allow-Origin": "*",
},
},
});
|
Beta Was this translation helpful? Give feedback.
0 replies
-
请发一下 vue 文件的内容 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
之前项目是采用vue-cli开发的
Beta Was this translation helpful? Give feedback.
All reactions