Permalink
Browse files

Add a Webpack config to pre-build a Cesium bundle

  • Loading branch information...
markerikson committed Mar 4, 2017
1 parent eabdcf5 commit 4ddc26ab024a90d5f4684eeefa4486cde9378513
Showing with 53 additions and 0 deletions.
  1. +53 −0 config/webpack.cesium.dll.config.js
@@ -0,0 +1,53 @@
"use strict";
const path = require("path");
const webpack = require("webpack");
const paths = require("./paths");
const env = require("./env");
const outputPath = path.join(paths.app, "distdll");
const webpackConfig = {
entry : {
cesiumDll : ["cesium/Source/Cesium.js"],
},
devtool : "#source-map",
output : {
path : outputPath,
filename : "[name].js",
library : "[name]_[hash]",
sourcePrefix: "",
},
plugins : [
new webpack.DllPlugin({
path : path.join(outputPath, "[name]-manifest.json"),
name : "[name]_[hash]",
context : paths.cesiumSourceFolder,
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify("production")
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
module : {
unknownContextCritical : false,
loaders : [
{ test : /\.css$/, loader: "style!css" },
{
test : /\.(png|gif|jpg|jpeg)$/,
loader : "file-loader",
},
],
},
};
module.exports = webpackConfig;

0 comments on commit 4ddc26a

Please sign in to comment.