-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I noticed an issue with TypeScript, not sure how to resolve this. #3
Comments
Editing 'babel-helper-vue-jsx-merge-props' to export with default fixes it: module.exports = {
default : function mergeJSXProps (objs) { ... }
} |
Installing babel.rc {
"presets": [],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs"]
} The line from the compiled code looks like this:
|
This is the correct configuration to use for a TypeScript and JSX with Vue: webpack.config.js: module.exports = {
entry: "./src/app.tsx",
output: {
filename: "bin/bundle.js"
},
resolve: {
// Add '.ts' and '.tsx' as a resolvable extension.
extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
},
module: {
loaders: [
// It's important to run 'babel' first this will avoid a compilation error
{ test: /\.tsx?$/, loader: "babel" },
// Run ts loader to transform our typescript into JS
{ test: /\.tsx?$/, loader: "ts-loader" }
]
},
// If you want to load 'vue' as an external, and not include it in your bundle
// simply add it to the array.
externals : []
}; .babelrc {
"presets": [],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs"]
} Bash npm i -S \
@types/core-js \
vue \
typescript \
ts-loader \
webpack \
babel \
babel-core \
babel-loader \
babel-plugin-syntax-jsx \
babel-plugin-transform-es2015-modules-commonjs \
babel-plugin-transform-vue-jsx \
babel-helper-vue-jsx-merge-props |
When rendered with
ts-loader
andbabel!ts
, there is a non existent pointer being used forbabel_helper_vue_jsx_merge_props_1
, that pointer isbabel_helper_vue_jsx_merge_props_1.default
,babel_helper_vue_jsx_merge_props_1
returns the correct function, where asbabel_helper_vue_jsx_merge_props_1.default
returns undefined..tsconfig
webpack.config.js
The text was updated successfully, but these errors were encountered: