webpack2项目引入ts后报错@ ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-compiler?

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

{
        test: /\.vue$/,
        loader: ‘vue-loader‘,
        options: {
          loaders: {
            ts:  [
              {
                loader: ‘ts-loader‘,
                options: {
                  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项目引入ts后报错@ ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-compiler?

上一篇:一键编译安装httpd-2.4.46(需要连接外网)


下一篇:微信小程序(六)