I am attempting to utilize the vuex-module-decorators library in a Laravel mix project that is using TypeScript. However, I keep encountering an error stating
Uncaught TypeError: Class constructor VuexModule cannot be invoked without 'new'
. This issue appears to be documented on GitHub and can be resolved by adding transpileDependencies: ['vuex-module-decorators']
to my vue.config.js
file, instructing Babel to transpile the package.
Since I am working with Laravel Mix, creating a vue.config.js
file does not have any effect. I am struggling to find a way to prompt Laravel Mix to transpile the vuex-module-decorators
dependency.
I have attempted to add
{ test: /\.js$/, loaders: ['babel-loader'] },
to the webpack configuration in webpack.mix.js
(even explicitly including the dependency), but it has not been successful.
Is there a method for directing Laravel Mix to transpile the vuex-module-decorators dependency into ES5?
If helpful, here is a glimpse of my webpack.mix.js
file:
mix
.ts('resources/ts/app.ts', 'public/js')
.stylus('resources/stylus/app.styl', 'public/css');