alibaba-fusion / materials

基于 icejs+fusion 的官方精品物料
https://fusion.design/template
239 stars 176 forks source link

Could not resolve "../node_modules/fmin/index.js #134

Open Tenodec opened 3 years ago

Tenodec commented 3 years ago

使用@alifd/fusion-design-pro创建模板项目 yarn start 报错

ERR! Build failed with 2 errors: node_modules/venn.js/src/diagram.js:6:25: error: Could not resolve "../node_modules/fmin/index.js" node_modules/venn.js/src/layout.js:2:20: error: Could not resolve "../node_modules/fmin/index.js"

ClarkXia commented 3 years ago

问题有 venn.js 引起, 参考 issue https://github.com/benfred/venn.js/issues/153 暂时可以通过以下方式配置:

{
  "vite": true,
+  "alias": {
+    "venn.js": "venn.js/build/venn.js"
+  },
  "plugins": [
    [
      "build-plugin-moment-locales",
      {
        "locales": [
          "zh-cn"
        ]
      }
    ],
    [
      "build-plugin-ignore-style",
      {
        "libraryName": "@alifd/next"
      }
    ]
  ]
}
bindoon commented 2 years ago

npx create ice @alifd/fusion-design-pro npm i npm start 是这么启动吧,为啥我启动正常呢?

image

chantAria commented 2 years ago

问题有 venn.js 引起, 参考 issue benfred/venn.js#153 暂时可以通过以下方式配置:

{
  "vite": true,
+  "alias": {
+    "venn.js": "venn.js/build/venn.js"
+  },
  "plugins": [
    [
      "build-plugin-moment-locales",
      {
        "locales": [
          "zh-cn"
        ]
      }
    ],
    [
      "build-plugin-ignore-style",
      {
        "libraryName": "@alifd/next"
      }
    ]
  ]
}

顺利解决,顺带一提,是在根目录的build.json里