sprinklers3/app/webpack/base.config.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-06-19 19:12:03 -06:00
const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
2017-09-07 12:26:23 -06:00
const rootDir = path.resolve(__dirname, "..", "..");
2017-06-19 19:12:03 -06:00
module.exports = {
entry: [
"core-js",
"./app/index.tsx"
],
2017-06-19 19:12:03 -06:00
output: {
2017-09-07 12:26:23 -06:00
path: path.resolve(rootDir, "public"),
filename: "bundle.js",
publicPath: "/",
2017-06-19 19:12:03 -06:00
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"],
2017-06-19 19:12:03 -06:00
alias: {
"@app": path.resolve(rootDir, "app"),
"@common": path.resolve(rootDir, "common"),
2017-06-19 19:12:03 -06:00
}
},
module: {
rules: [
{ test: /\.css$/, use: ["style-loader", "css-loader"] },
{ test: /\.(ttf|eot|svg|woff(2)?|png|jpg)(\?[a-z0-9=&.]+)?$/, use: "file-loader" },
{
test: /\.tsx?$/, use: {
loader: "awesome-typescript-loader",
options: { configFileName: path.resolve(rootDir, "app", "tsconfig.json") }
},
},
2017-06-19 19:12:03 -06:00
]
},
plugins: [
new HtmlWebpackPlugin({
template: "./app/index.html"
}),
],
};