webpack2项目中引入@vue/composition-api报错Cannot find module

在webpack.base.conf.js中的vue配置中加入

transpileOnly: true,

如下为完整配置:

{
        test: /\.vue$/,
        loader: ‘vue-loader‘,
        options: {
          loaders: {
            ts:  [
              {
                loader: ‘ts-loader‘,
                options: {
                  transpileOnly: true,
                  appendTsSuffixTo: [/\.vue$/]
                }
              }],
            scss: [
              ‘vue-style-loader!css-loader!sass-loader‘,
              // 全局sass变量
              {
                loader: ‘sass-resources-loader‘,
                options: {
                  // 需更改为项目中实际scss文件路径
                  resources: path.resolve(__dirname, ‘../src-mobile/styles/global.scss‘),
                },
              },
            ], // <style lang="scss">
            sass: ‘vue-style-loader!css-loader!sass-loader‘ // <style lang="sass">
          },
          options: {
            esModule: true
          }
        }
      },

  

webpack2项目中引入@vue/composition-api报错Cannot find module

上一篇:window下杀掉某网络TCP进程


下一篇:C# 调用腾讯即时通信 IM《转发》