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/config/web-cad-view.config.ts

72 lines
2.2 KiB

var path = require('path');
var HtmlWebPackPlugin = require("html-webpack-plugin");
var AddAssetHtmlPlugin = require("add-asset-html-webpack-plugin");
var ExtractTextPlugin = require('extract-text-webpack-plugin');
const webpack = require('webpack');
module.exports = {
entry: "./src/webview.ts",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, 'dist')
},
devtool: "source-map",
resolve: {
alias: {},
extensions: [".ts", ".tsx", ".js", "json"]
},
module: {
loaders: [
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" },
{ test: /\.[(png)|(jpg)|(obj)]$/, loader: "file-loader" },
{
test: /\.css$/,
4 years ago
use: ExtractTextPlugin.extract({ use: 'css-loader' })
},
{
test: /\.less$/,
use:
[
4 years ago
{ loader: "style-loader" },
{ loader: "css-loader" },
{
4 years ago
loader: "less-loader",
options:
{
strictMath: true,
noIeCompat: true
}
}
]
}
]
},
// Other options...
devServer: {
contentBase: path.join(__dirname, "dist"),
compress: true,
port: 7777
},
plugins: [
new webpack.DllReferencePlugin({
context: '.',
manifest: require(path.resolve(__dirname, "./manifest.json"))
}),
new HtmlWebPackPlugin(
{
title: "webCAD",
template: 'index.html'
}),
new AddAssetHtmlPlugin({ filepath: path.resolve(__dirname, "./dist/dll.js") }),
new ExtractTextPlugin({ filename: 'styles.css' }),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
ReactDOM: 'react-dom',
React: 'react',
THREE: "three",
}),
new webpack.optimize.ModuleConcatenationPlugin()
]
};