错误:意外字符'@';(请注意,您需要插件来导入非JavaScript文件)
我在rollupjs中使用一个带有vue和scss的模板,但我不能使用@import。。我犯了一个错误。这是为什么。把配置文件放在上面错误:意外字符'@';(请注意,您需要插件来导入非JavaScript文件),javascript,rollup,rollupjs,Javascript,Rollup,Rollupjs,我在rollupjs中使用一个带有vue和scss的模板,但我不能使用@import。。我犯了一个错误。这是为什么。把配置文件放在上面 import { terser } from "rollup-plugin-terser"; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; // wild card import mult
import { terser } from "rollup-plugin-terser";
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
// wild card
import multi from '@rollup/plugin-multi-entry';
import VuePlugin from 'rollup-plugin-vue'
import babel from '@rollup/plugin-babel';
export default {
input: './src/javascripts/**/*.js',
output: {
dir: 'output',
format: 'cjs'
},
plugins: [
VuePlugin({
preprocessOptions: {
scss: {
includePaths: ['./src/style', 'node_modules'],
},
}
}),
terser(),
resolve(),
commonjs(),
babel({ babelHelpers: 'bundled' }),
multi()
]
};
这是我正在使用的.vue文件
<template>
〜abridgement〜
</template>
<script>
〜abridgement〜
</script>
<style lang="scss" scoped>
@import "./src/style/foundation/xxx";
@import "./src/style/foundation/xxx";
~节略〜
~节略〜
@导入“/src/style/foundation/xxx”;
@导入“/src/style/foundation/xxx”;
无法使用@import
。。。您在哪里使用@import
?不在您所展示的代码中-似乎有什么地方正在尝试导入css-但导入仅适用于js文件(除非您使用插件,错误告诉您)使用vuefile.vue```〜〜〜@import./src/style/foundation/variable@导入“/src/style/foundation/mixin”〜〜〜〜```