pathfinder/demo/client/webpack.config.js

54 lines
1.5 KiB
JavaScript
Raw Normal View History

const Handlebars = require('handlebars');
const HandlebarsPlugin = require('handlebars-webpack-plugin');
const fs = require('fs');
2017-08-08 14:23:30 -04:00
module.exports = {
devtool: 'inline-source-map',
2017-08-25 23:20:45 -04:00
entry: {
2017-08-29 22:46:18 -04:00
'3d-demo': "./src/3d-demo.ts",
'svg-demo': "./src/svg-demo.ts",
'text-demo': "./src/text-demo.ts",
'reference-test': "./src/reference-test.ts",
'benchmark': "./src/benchmark.ts",
2017-09-01 21:11:44 -04:00
'mesh-debugger': "./src/mesh-debugger.ts",
2017-08-25 23:20:45 -04:00
},
2017-08-08 14:23:30 -04:00
module: {
rules: [
2017-09-28 17:34:48 -04:00
{
2017-10-13 23:35:51 -04:00
test: /src(\/|\\)[a-zA-Z0-9_-]+\.tsx?$/,
2017-09-28 17:34:48 -04:00
enforce: 'pre',
loader: 'tslint-loader',
exclude: /node_modules/,
options: {
configFile: "tslint.json",
},
},
2017-08-08 14:23:30 -04:00
{
2017-10-13 23:35:51 -04:00
test: /src(\/|\\)[a-zA-Z0-9_-]+\.tsx?$/,
2017-08-08 14:23:30 -04:00
use: 'ts-loader',
exclude: /node_modules/,
},
2017-08-08 14:23:30 -04:00
]
},
resolve: {
extensions: [".tsx", ".ts", ".html", ".js"],
2017-08-08 14:23:30 -04:00
},
output: {
2017-08-25 23:20:45 -04:00
filename: "[name].js",
2017-08-08 14:23:30 -04:00
path: __dirname,
},
plugins: [
new HandlebarsPlugin({
entry: "html/*.hbs",
output: "./[name]",
partials: ["html/partials/*.hbs"],
helpers: {
octicon: function(iconName) {
const svg = fs.readFileSync(`node_modules/octicons/build/svg/${iconName}.svg`);
return new Handlebars.SafeString(svg);
}
},
})
]
2017-08-08 14:23:30 -04:00
}