Comments (3)
Editing 'babel-helper-vue-jsx-merge-props' to export with default fixes it:
module.exports = {
default : function mergeJSXProps (objs) { ... }
}
from babel-helper-vue-jsx-merge-props.
Installing $ npm install --save-dev babel-preset-es2015
seems to fix the issue, except now I get this error with no answer online on how to resolve it: Left side of comma operator is unused and has no side effects.
The error does away when the spread operator is not used.
babel.rc
{
"presets": [],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs"]
}
The line from the compiled code looks like this:
Vue.component('todoApp', {
render: function (h) {
return h("div", (0, _babelHelperVueJsxMergeProps2.default)([{ "class": "this" }, { class: "that" }]), []);
}
});
from babel-helper-vue-jsx-merge-props.
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
from babel-helper-vue-jsx-merge-props.
Related Issues (10)
- problem of merging classNames
- Merge props function mutates given object. HOT 1
- Why nest merge of 'directives' is not supported?
- npm install error HOT 1
- Missing LICENSE
- problem of merging functions HOT 1
- Differences in importing and exporting with babel-plugin-transform-vue-jsx HOT 1
- Problem of merging functions from prefixed handler and VNodeData object HOT 1
- Merging doesn't appear to be symmetrical HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-helper-vue-jsx-merge-props.