Last active
August 19, 2017 09:00
-
-
Save foxbunny/aca6f074e4eb86d4906afb12b7816c37 to your computer and use it in GitHub Desktop.
Bare-bones webpack 2 configuration for typescript projects
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
/** | |
* (c) 2017 Hajime Yamasaki Vukelic | |
* Some rights reserved. | |
* | |
* yarn add -D webpack webpack-dev-server ts-node ts-loader html-webpack-plugin @types/webpack @types/html-webpack-plugin | |
*/ | |
import path = require("path"); | |
import HTMLWebpackPlugin = require("html-webpack-plugin"); | |
import webpack = require("webpack"); | |
export default function(env: object | void) { | |
return { | |
entry: "./src/index.ts", | |
module: { | |
rules: [ | |
{ | |
test: /.tsx?$/, | |
use: "ts-loader", | |
}, | |
], | |
}, | |
output: { | |
filename: "bundle.js", | |
path: path.resolve(__dirname, "build"), | |
}, | |
plugins: [ | |
new HTMLWebpackPlugin(), | |
], | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment