簡體   English   中英

vue.config.js 似乎沒有加載

[英]vue.config.js does not seem to load

在:

https://codesandbox.io/s/dazzling-jepsen-r7283?file=/vue.config.js

基於:

https://stackoverflow.com/a/68308416/1079483

vue.config.js

const path = require("path");
module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        "modal-styles": path.resolve(__dirname, "./src/styles/modal-style.css")
      }
    }
  },
  css: {
    loaderOptions: {
      less: {
        modifyVars: {},
        javascriptEnabled: true
      }
    }
  }
};

不是由 vue-cli 加載的。 這個想法是復制:

https://codesandbox.io/s/cs-vue-cli-3-vj2rl?file=/vue.config.js

當到達EditCategory.vuestyles標簽時:

<style scoped>
@import 'modal-styles';
</style>

無法讀取別名:

TypeError
Path must be a string. Received null
r
https://codesandbox.io/static/js/common-sandbox.7be24d846.chunk.js:1:246770
Object.isAbsolute
https://codesandbox.io/static/js/common-sandbox.7be24d846.chunk.js:1:247916
(anonymous function)
https://codesandbox.io/static/js/vendors~postcss-compiler~vue-style-compiler.f9e51cefa.chunk.js:1:1069
(anonymous function)
https://codesandbox.io/static/js/vendors~postcss-compiler~vue-style-compiler.f9e51cefa.chunk.js:1:1060
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.
This error overlay is powered by `react-error-overlay` used in `create-react-app`.

路徑style錯誤:

<style>
  @import '/src/styles/modal-style.css';
</style>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM