You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/webpack.config.js

61 lines
2.2 KiB

8 years ago
var path = require('path');
var HtmlWebPackPlugin = require("html-webpack-plugin");
7 years ago
var AddAssetHtmlPlugin = require("add-asset-html-webpack-plugin");
const webpack = require('webpack');
8 years ago
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')
},
8 years ago
// 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" },
7 years ago
// { 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' }
],
8 years ago
// 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
}
,
7 years ago
plugins: [
new webpack.DllReferencePlugin({
context: '.',
manifest: require(path.resolve(__dirname, "./manifest.json"))
}),
new HtmlWebPackPlugin(),
new AddAssetHtmlPlugin({ filepath: path.resolve(__dirname, "./dist/dll.js") }),
]
8 years ago
};