57 lines
1.4 KiB
JavaScript
57 lines
1.4 KiB
JavaScript
const path = require("path");
|
|
const webpack = require("webpack");
|
|
|
|
module.exports = {
|
|
entry: ["./src/main.ts"],
|
|
mode: "production",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
exclude: /(node_modules|bower_components|\.d\.ts$)/,
|
|
use: [
|
|
"babel-loader",
|
|
],
|
|
},
|
|
{
|
|
test: /\.d\.ts$/,
|
|
loader: 'ignore-loader'
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ["style-loader", "css-loader"]
|
|
},
|
|
{
|
|
test: /\.(png|jpe?g|gif|ttf|woff2?|eot|svg)$/i,
|
|
use: [
|
|
{
|
|
loader: 'file-loader',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.glsl$/i,
|
|
use: [
|
|
{
|
|
loader: 'raw-loader',
|
|
},
|
|
],
|
|
}
|
|
]
|
|
},
|
|
resolve: { extensions: [".tsx", ".ts", ".js", "*"] },
|
|
output: {
|
|
path: path.resolve(__dirname, "build/"),
|
|
publicPath: "/",
|
|
filename: "bundle.js"
|
|
},
|
|
devServer: {
|
|
contentBase: path.join(__dirname, "build/"),
|
|
contentBasePublicPath: "/",
|
|
port: 3000,
|
|
publicPath: "http://localhost:3000/",
|
|
hotOnly: true
|
|
},
|
|
plugins: [new webpack.HotModuleReplacementPlugin()]
|
|
};
|