Importing Vue components in TypeScript file

前端 未结 4 746
伪装坚强ぢ
伪装坚强ぢ 2020-12-16 15:50

I have been trying to use Vue.js with TypeScript and I came across this repo.

I faced issues here that I am getting error while importing Vue Single Component File f

4条回答
  •  暖寄归人
    2020-12-16 15:58

    When using the vue-cli, adapt vue-loader-conf.js as follows:

    var utils = require('./utils')
    var config = require('../config')
    var isProduction = process.env.NODE_ENV === 'production'
    
    module.exports = {
      loaders: utils.cssLoaders({
    
        sourceMap: isProduction
          ? config.build.productionSourceMap
          : config.dev.cssSourceMap,
        extract: isProduction, esModule: true
      }), esModule: true
    }
    

提交回复
热议问题