Getting Started
Module Loaders
Since we're dealing with the decorators then we need to desugar/transform our code that browsers can read it.
Javascript ES6
You will need babel with preset es2015
and transform-decorators-legacy
plugin.
Here's the loader configuration if you go with webpack
:
...
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-decorators-legacy']}
},
...
Clone full example code here.
Typescript
Only required single module loader to work with Typescript 2.0
. It's a ts-loader.
...
loaders: [
{ test: /\.ts(x?)$/, loader: 'ts' },
...
Clone full example here.
Unless you want to support minification in your code that using UglifyJsPlugin,
then you'll need babel
loader with preset es2015
.
To learn more detail about this you can start creating application using vue-typed-boilerplate and see the generated webpack.config.js
file.