Skip to content

Instantly share code, notes, and snippets.

@andi1984
Forked from nojaf/package.json
Created June 11, 2016 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andi1984/d3a5d1730ab5f6130af914efc616ab62 to your computer and use it in GitHub Desktop.
Save andi1984/d3a5d1730ab5f6130af914efc616ab62 to your computer and use it in GitHub Desktop.
From TypeScript to Babel to ES5 with webpack
{
"name": "webpack-ts-babel",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"ts-loader": "^0.7.1",
"typescript": "^1.6.2",
"webpack": "^1.12.6"
}
}
{
"compilerOptions": {
"target": "ES6"
},
"files": [
"app.ts",
"util.ts"
]
}
module.exports = {
entry: "./app.ts",
output: {
filename: "bundle.js"
},
module: {
loaders: [
// note that babel-loader is configured to run after ts-loader
{ test: /\.ts(x?)$/, loader: "babel-loader?presets[]=es2015!ts-loader" }
]
},
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".ts", ".js"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment