var path = require('path'); var HtmlWebPackPlugin = require("html-webpack-plugin"); var AddAssetHtmlPlugin = require("add-asset-html-webpack-plugin"); const webpack = require('webpack'); module.exports = { entry: "./src/index.ts", output: { filename: "bundle.js", path: path.resolve(__dirname, 'dist') }, // Enable sourcemaps for debugging webpack's output. devtool: "source-map", resolve: { alias: { "dat.gui": path.resolve(__dirname, './node_modules/dat.gui/build/dat.gui.js') }, // Add '.ts' and '.tsx' as resolvable extensions. extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"] }, module: { loaders: [ // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. { test: /\.tsx?$/, loader: "awesome-typescript-loader" }, // { test: /\.[(png)|(jpg)]$/, loader: "file-loader" }, // //gui.dat // { test: /\.css$/, loader: 'style-loader!css-loader' }, // { test: /\.png$/, loader: 'url-loader?limit=100000' }, // { // test: /\.scss$/, // use: [{ // loader: "style-loader" // creates style nodes from JS strings // }, { // loader: "css-loader" // translates CSS into CommonJS // }, { // loader: "sass-loader" // compiles Sass to CSS // }] // }, // { test: /\.html$/, loader: 'html-loader' } ], // preLoaders: [ // // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. // { test: /\.js$/, loader: "source-map-loader" } // ] }, // Other options... devServer: { contentBase: path.join(__dirname, "dist"), compress: true, port: 8188 } , plugins: [ new webpack.DllReferencePlugin({ context: '.', manifest: require(path.resolve(__dirname, "./manifest.json")) }), new HtmlWebPackPlugin(), new AddAssetHtmlPlugin({ filepath: path.resolve(__dirname, "./dist/dll.js") }), ] };