1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- const path = require('path');
- const webpack = require('webpack');
- module.exports = {
- entry: {
- 'babylonjs-gui': './src/index.ts',
- },
- output: {
- path: path.resolve(__dirname, 'dist'),
- filename: '[name].js',
- libraryTarget: 'umd',
- library: {
- root: ["BABYLON", "GUI"],
- amd: "babylonjs-gui",
- commonjs: "babylonjs-gui"
- },
- //globalObject: "BABYLON",
- umdNamedDefine: true,
- devtoolModuleFilenameTemplate: '[relative-resource-path]'
- },
- resolve: {
- extensions: [".js", '.ts']
- },
- externals: {
- babylonjs: {
- root: "BABYLON",
- commonjs: "babylonjs",
- commonjs2: "babylonjs",
- amd: "babylonjs"
- }
- },
- plugins: [
- new webpack.WatchIgnorePlugin([
- /\.d\.ts$/
- ]),
- // fixing a small issue when root is an array and not a string
- /*new webpack.SourceMapDevToolPlugin({
- namespace: "BABYLON.GUI"
- })*/
- ],
- module: {
- rules: [
- {
- test: /\.tsx?$/,
- loader: "ts-loader",
- exclude: /node_modules/
- },
- {
- test: /\.fx$/,
- use: [
- {
- loader: path.resolve('../Tools/WebpackShaderLoader/index.js')
- }
- ]
- }]
- },
- mode: "development",
- devServer: {
- contentBase: path.join(__dirname, "dist"),
- compress: false,
- //open: true,
- port: 9000
- }
- }
- //]
|