How can I use typescript for Vuex files (store/index.js => store/index.ts)?

DarKCoder666
0
DarKCoder666
commented 6 months ago

Right now, I have the next config(plugins/typescript.js) for typescript files:
export default function typescript (moduleOptions) {
// Extends Webpack Configuration
this.extendBuild(config => {
// Add typescript extension to resolve list
config.resolve.extensions.push('ts', 'tsx')
// Add rule for typescript loader
config.module.rules.push({
test: /.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/.vue$/]
}
})
})
}

I use TypeScript syntax in .vue files(Components), and I also want to use TypeScript syntax for store files.
If I just rename the files into .ts, the store becomes invisible for components.

0
Informations
Question โ€ข Unresolved
#c92 - Created 6 months ago