js dynamic import default JSON file All In One


js dynamic import default JSON file All In One


bug

The above dynamic import cannot be analyzed by vite.

See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats.

If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

Plugin: vite:import-analysis

https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations

solution ?

$ npm i -D @rollup/plugin-dynamic-import-vars

// rollup.config.js

import dynamicImportVars from '@rollup/plugin-dynamic-import-vars';

export default {
  plugins: [
    dynamicImportVars({
      // options
    })
  ]
};


Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/json".
Strict MIME type checking is enforced for module scripts per HTML spec.

demo

https://vueschool.io/lessons/synchronous-and-asynchronous-actions-in-pinia

refs


Flag Counter

?xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有??xgqfrms, 禁止转载 ???,侵权必究??!