troonia/webpack.common.cjs

31 lines
629 B
JavaScript
Raw Normal View History

2022-10-24 05:20:36 +00:00
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
entry: './src/client/main.ts',
plugins: [
new CopyPlugin({
patterns: [{
from: "index.html",
to: "."
}]
})
],
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: [/node_modules/, /server/],
},
],
},
resolve: {
alias: {three: path.resolve('./node_modules/three/')},
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, './dist/client/'),
}
};