Created
July 15, 2019 13:20
-
-
Save jcormont/fd735895a7efaee76763dad1c690252c to your computer and use it in GitHub Desktop.
Basic TypeScript/Webpack config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"strict": true, | |
"module": "es2015", | |
"moduleResolution": "node", | |
"target": "es5", | |
"lib": ["es2015", "dom"], | |
"experimentalDecorators": true, | |
"downlevelIteration": true, | |
"sourceMap": true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
module.exports = { | |
entry: { | |
app: path.resolve(__dirname, "app.ts") | |
}, | |
output: { | |
filename: "[name].bundle.js", | |
chunkFilename: "[name].[chunkhash].bundle.js", | |
// set the output path here: | |
path: path.resolve(__dirname, "../../js") | |
}, | |
resolve: { | |
extensions: [".ts", ".js"], | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.ts$/, | |
loader: "ts-loader", | |
options: { transpileOnly: true } | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment