diff --git a/.eslintignore b/.eslintignore index 06c5e168..38474240 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1 @@ -dist/** +*/dist/** diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..2c1a54b7 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,18 @@ +name: lint +on: push +jobs: + build: + runs-on: ubuntu-latest + name: Lint/Format check + steps: + - uses: actions/checkout@v3 + - name: install node 20 + uses: actions/setup-node@v3 + with: + node-version: 20 + - name: install + run: npm install + - name: lint *.js + run: npm run eslint + - name: format code + run: npm run prettier-check diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35b397b3..c92ed8b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,11 @@ jobs: strategy: matrix: node: [18, 20] - name: Node ${{ matrix.node }} + webpack-dir: [webpack-4, webpack-5] + name: Node ${{ matrix.node }} - ${{ matrix.webpack-dir }} + defaults: + run: + working-directory: ${{ matrix.webpack-dir }} steps: - uses: actions/checkout@v3 - name: install node ${{ matrix.node }} @@ -15,9 +19,5 @@ jobs: node-version: ${{ matrix.node }} - name: install run: npm install - - name: lint *.js - run: npm run eslint - - name: format code - run: npm run prettier-check - name: build run: npm run build diff --git a/.gitignore b/.gitignore index 2f72fe4f..38103080 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -/dist/ -/node_modules/ +dist/ +node_modules/ package-lock.json .DS_Store .eslintcache diff --git a/.prettierignore b/.prettierignore index eab7d5e8..2fd774f2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,8 +5,10 @@ # Unignore directories (to all depths) and unignore code and style files in these directories !.github/**/ !.vscode/**/ -!src/**/ !doc/**/ +!webpack-4/**/ +!webpack-5/**/ +!src/**/ !**/*.js !**/*.css diff --git a/.prettierrc b/.prettierrc index 0967ef42..9e26dfee 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1 +1 @@ -{} +{} \ No newline at end of file diff --git a/README.md b/README.md index abc2e055..81651044 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,20 @@ # cesium-webpack-example -A minimal recommended setup for an applications using [Cesium](https://cesium.com) with [Webpack](https://webpack.js.org/concepts/). +A minimal recommended setup for an applications using [Cesium](https://cesium.com) with [Webpack](https://webpack.js.org/). -[![Build Status](https://travis-ci.org/CesiumGS/cesium-webpack-example.svg?branch=using-custom-loader)](https://travis-ci.org/CesiumGS/cesium-webpack-example) +Jump to the [Webpack 5](./webpack-5/) directory for the most up to date example. We also provide a [Webpack 4](./webpack-4/) example if you are still on the older version. ## Running this application -```sh -npm install -npm start -``` - -Navigate to `localhost:8080`. +Please switch to the corresponding sub-directory for the version of Webpack you're using to see how to run this example application -### Available scripts - -- `npm start` - Runs a webpack build with `webpack.config.js` and starts a development server -- `npm run build` - Runs a webpack build with `webpack.config.js` +- [Webpack 4 commands](./webpack-4/README.md#running-this-application) +- [Webpack 5 commands](./webpack-5/README.md#running-this-application) ## Requiring Cesium in your application +Regardless which version of Webpack you're using you should be able to use CesiumJS in the same way. + We recommend [importing named exports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) from the Cesium ES module, via the `import` keyword. This allows webpack to [tree shake](https://webpack.js.org/guides/tree-shaking/) your application automatically. ### Import named modules from Cesium @@ -37,7 +32,20 @@ import "cesium/Build/Cesium/Widgets/widgets.css"; ## Cesium sub-packages -CesiumJS requires a few static files to be hosted on your server, like web workers and SVG icons. This example is set up to copy these directories already if you install the whole `cesium` package. However if you only install `@cesium/engine` then you should change the paths in `webpack.config.js` to the ones below: +CesiumJS requires a few static files to be hosted on your server, like web workers and SVG icons. These examples are set up to copy these directories already if you install the whole `cesium` package. + +```js +new CopyWebpackPlugin({ + patterns: [ + { from: path.join(cesiumSource, "Workers"), to: `${cesiumBaseUrl}/Workers`, }, + { from: path.join(cesiumSource, "ThirdParty"), to: `${cesiumBaseUrl}/ThirdParty`, }, + { from: path.join(cesiumSource, "Assets"), to: `${cesiumBaseUrl}/Assets`, }, + { from: path.join(cesiumSource, "Widgets"), to: `${cesiumBaseUrl}/Widgets`, }, + ], +}), +``` + +However if you only install `@cesium/engine` then you should change the paths in `webpack.config.js` to the ones below: ```js new CopyWebpackPlugin({ @@ -85,6 +93,23 @@ rules: [ Pull requests are appreciated. Please use the same [Contributor License Agreement (CLA)](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md) used for [Cesium](https://cesium.com/). +Even though this project has nested package.json projects we are not using `npm` workspaces to preserve a more "stand-alone" nature for each example. This allows other developers to copy the sub-directory and use it as-is for a new project. + +Make sure you run `npm install` in the root directory to set up linting and git commit hooks + +### Available scripts + +The top level scripts in the root directory are mostly for development of this repo itself: + +- `npm run eslint`, `npm run prettier`, `npm run prettier-check` - Lint this project to maintain code style + +There are also some shortcuts to run the code for each Webpack version. These are just for convenience and behave the same as changing to the sub-directories and running the commands there + +- `npm run start-4` - Run the Webpack 4 example +- `npm run build-4` - Build the Webpack 4 example +- `npm run start-5` - Run the Webpack 5 example +- `npm run build-5` - Build the Webpack 5 example + --- Developed by the Cesium team. diff --git a/doc/cesium.png b/doc/cesium.png deleted file mode 100644 index 32db6169..00000000 Binary files a/doc/cesium.png and /dev/null differ diff --git a/package.json b/package.json index f0154203..b705455c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cesiumjs-webpack-example", "version": "1.0.0", - "description": "The minimal recomended setup for an app using Cesium with Webpack.", + "description": "The minimal recommended setup for an app using Cesium with Webpack.", "homepage": "https://cesium.com/platform/cesiumjs/", "license": "Apache-2.0", "author": { @@ -18,33 +18,27 @@ "type": "git", "url": "https://github.com/CesiumGS/cesium-webpack-example.git" }, - "main": "index.js", "scripts": { - "build": "webpack --config webpack.config.js", - "start": "webpack serve --config webpack.config.js", - "start:built": "npx http-server -a localhost -p 8080 dist/", + "prepare": "husky install", + "postinstall": "cd webpack-4 && npm install && cd ../webpack-5 && npm install", "eslint": "eslint \"./**/*.js\" \"./**/*.html\" --cache --quiet", "prettier": "prettier --write --no-config \"**/*\"", - "prettier-check": "prettier --check --no-config \"**/*\"" + "prettier-check": "prettier --check --no-config \"**/*\"", + "start-4": "cd webpack-4 && npm run start", + "build-4": "cd webpack-4 && npm run build", + "start-5": "cd webpack-5 && npm run start", + "build-5": "cd webpack-5 && npm run build" }, "devDependencies": { - "cesium": "^1.113.0", - "copy-webpack-plugin": "^9.1.0", - "css-loader": "^6.8.1", "eslint": "^8.56.0", "eslint-config-cesium": "^10.0.2", "eslint-plugin-es": "^4.1.0", "eslint-plugin-html": "^7.1.0", - "html-webpack-plugin": "^5.6.0", "husky": "^8.0.3", - "prettier": "^3.1.1", - "style-loader": "^3.3.3", - "webpack": "^5.89.0", - "webpack-cli": "^4.10.0", - "webpack-dev-server": "^4.15.1" + "prettier": "^3.1.1" }, "lint-staged": { - "*.{js,cjs,html}": [ + "*.{js,html}": [ "eslint --cache --quiet", "prettier --write --no-config" ] diff --git a/.npmignore b/webpack-4/.npmignore similarity index 100% rename from .npmignore rename to webpack-4/.npmignore diff --git a/webpack-4/README.md b/webpack-4/README.md new file mode 100644 index 00000000..9a8c8fa8 --- /dev/null +++ b/webpack-4/README.md @@ -0,0 +1,105 @@ +# cesium-webpack-example + +A minimal recommended setup for an applications using [Cesium](https://cesium.com) with [Webpack 4](https://v4.webpack.js.org/concepts/). + +## Running this application + +```sh +npm install +npm start +# for the built version +npm run build +npm run start:built +``` + +Navigate to `localhost:8080`. + +### Available scripts + +- `npm start` - Runs a webpack build with `webpack.config.js` and starts a development server at `localhost:8080` +- `npm run build` - Runs a webpack build with `webpack.config.js` +- `npm run start:built` - Start a small static server using `http-server` to demonstrate hosting the built version + +## Requiring Cesium in your application + +We recommend [importing named exports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) from the Cesium ES module, via the `import` keyword. This allows webpack to [tree shake](https://webpack.js.org/guides/tree-shaking/) your application automatically. + +### Import named modules from Cesium + +```js +import { Color } from "cesium"; +var c = Color.fromRandom(); +``` + +### Import Cesium static asset files + +```js +import "cesium/Build/Cesium/Widgets/widgets.css"; +``` + +## Cesium sub-packages + +CesiumJS requires a few static files to be hosted on your server, like web workers and SVG icons. This example is set up to copy these directories already if you install the whole `cesium` package. + +```js +new CopyWebpackPlugin({ + patterns: [ + { from: path.join(cesiumSource, "Workers"), to: `${cesiumBaseUrl}/Workers`, }, + { from: path.join(cesiumSource, "ThirdParty"), to: `${cesiumBaseUrl}/ThirdParty`, }, + { from: path.join(cesiumSource, "Assets"), to: `${cesiumBaseUrl}/Assets`, }, + { from: path.join(cesiumSource, "Widgets"), to: `${cesiumBaseUrl}/Widgets`, }, + ], +}), +``` + +However if you only install `@cesium/engine` then you should change the paths in `webpack.config.js` to the ones below: + +```js +new CopyWebpackPlugin({ + patterns: [ + { from: 'node_modules/@cesium/engine/Build/Workers', to: `${cesiumBaseUrl}/Workers` }, + { from: 'node_modules/@cesium/engine/Build/ThirdParty', to: `${cesiumBaseUrl}/ThirdParty` }, + { from: 'node_modules/@cesium/engine/Source/Assets', to: `${cesiumBaseUrl}/Assets` }, + ], +}), +``` + +## Removing pragmas + +To remove pragmas such as a traditional Cesium release build, use the [`strip-pragma-loader`](https://www.npmjs.com/package/strip-pragma-loader). + +Install the plugin with npm, + +```sh +npm install strip-pragma-loader --save-dev +``` + +and include the loader in `module.rules` with `debug` set to `false`. + +```js +rules: [ + { + test: /\.js$/, + enforce: "pre", + include: path.resolve(__dirname, cesiumSource), + use: [ + { + loader: "strip-pragma-loader", + options: { + pragmas: { + debug: false, + }, + }, + }, + ], + }, +]; +``` + +## Contributions + +Pull requests are appreciated. Please use the same [Contributor License Agreement (CLA)](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md) used for [Cesium](https://cesium.com/). + +--- + +Developed by the Cesium team. diff --git a/webpack-4/package.json b/webpack-4/package.json new file mode 100644 index 00000000..0421be0b --- /dev/null +++ b/webpack-4/package.json @@ -0,0 +1,45 @@ +{ + "name": "cesiumjs-webpack-4-example", + "version": "1.0.0", + "description": "The minimal recommended setup for an app using Cesium with Webpack 4", + "homepage": "https://cesium.com/platform/cesiumjs/", + "license": "Apache-2.0", + "author": { + "name": "Cesium GS, Inc.", + "url": "https://cesium.com" + }, + "keywords": [ + "cesium", + "CesiumJS", + "webpack", + "example" + ], + "repository": { + "type": "git", + "url": "https://github.com/CesiumGS/cesium-webpack-example.git" + }, + "main": "index.js", + "scripts": { + "build": "webpack --config webpack.config.js", + "start": "webpack serve --config webpack.config.js", + "start:built": "npx http-server -a localhost -p 8080 dist/" + }, + "dependencies": { + "cesium": "^1.113.0" + }, + "devDependencies": { + "@babel/core": "^7.23.7", + "@babel/plugin-transform-optional-chaining": "^7.23.4", + "@babel/preset-env": "^7.23.7", + "@open-wc/webpack-import-meta-loader": "^0.4.7", + "babel-loader": "^8.3.0", + "copy-webpack-plugin": "^6.4.1", + "css-loader": "^5.2.7", + "file-loader": "^6.2.0", + "html-webpack-plugin": "^4.5.2", + "style-loader": "^2.0.0", + "webpack": "^4.47.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.15.1" + } +} diff --git a/src/.eslintrc.json b/webpack-4/src/.eslintrc.json similarity index 100% rename from src/.eslintrc.json rename to webpack-4/src/.eslintrc.json diff --git a/src/css/main.css b/webpack-4/src/css/main.css similarity index 100% rename from src/css/main.css rename to webpack-4/src/css/main.css diff --git a/src/index.html b/webpack-4/src/index.html similarity index 100% rename from src/index.html rename to webpack-4/src/index.html diff --git a/webpack-4/src/index.js b/webpack-4/src/index.js new file mode 100644 index 00000000..103f912b --- /dev/null +++ b/webpack-4/src/index.js @@ -0,0 +1,32 @@ +import { + Viewer, + Cartesian3, + Math, + Terrain, + createOsmBuildingsAsync, +} from "cesium"; +import "cesium/Build/Cesium/Widgets/widgets.css"; +import "./css/main.css"; + +// CesiumJS has a default access token built in but it's not meant for active use. +// please set your own access token can be found at: https://cesium.com/ion/tokens. +// Ion.defaultAccessToken = "YOUR TOKEN HERE"; + +// Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID. +const viewer = new Viewer("cesiumContainer", { + terrain: Terrain.fromWorldTerrain(), +}); + +// Add Cesium OSM Buildings, a global 3D buildings layer. +createOsmBuildingsAsync().then((buildingTileset) => { + viewer.scene.primitives.add(buildingTileset); +}); + +// Fly the camera to San Francisco at the given longitude, latitude, and height. +viewer.camera.flyTo({ + destination: Cartesian3.fromDegrees(-122.4175, 37.655, 400), + orientation: { + heading: Math.toRadians(0.0), + pitch: Math.toRadians(-15.0), + }, +}); diff --git a/webpack-4/webpack.config.js b/webpack-4/webpack.config.js new file mode 100644 index 00000000..44e528bf --- /dev/null +++ b/webpack-4/webpack.config.js @@ -0,0 +1,89 @@ +"use strict"; + +const CopyWebpackPlugin = require("copy-webpack-plugin"); +const path = require("path"); +const webpack = require("webpack"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); + +const cesiumSource = "node_modules/cesium/Build/Cesium"; +// this is the base url for static files that CesiumJS needs to load +// Not required but if it's set remember to update CESIUM_BASE_URL as shown below +const cesiumBaseUrl = "cesiumStatic"; + +module.exports = { + entry: "./src/index.js", + output: { + filename: "app.js", + path: path.resolve(__dirname, "dist"), + }, + module: { + unknownContextCritical: false, + rules: [ + { + test: /\.(?:js|mjs|cjs)$/, + exclude: { + and: [/node_modules/], // Exclude libraries in node_modules ... + not: [/cesium/], // Except Cesium because it uses modern syntax + }, + use: [ + { + loader: "babel-loader", + options: { + presets: [ + ["@babel/preset-env", { targets: "defaults, not ie 11" }], + ], + plugins: ["@babel/plugin-transform-optional-chaining"], + }, + }, + // Babel understands the import.meta syntax but doesn't transform it in any way + // However Webpack can't parse this and throws an error for an unexpected token + // we need to use this extra loader so Webpack can actually bundle the code + // https://www.npmjs.com/package/@open-wc/webpack-import-meta-loader + require.resolve("@open-wc/webpack-import-meta-loader"), + ], + }, + { + test: /\.css/, + use: ["style-loader", "css-loader"], + }, + { + test: /\.(png|gif|jpg|jpeg|svg|xml|json)$/, + use: ["file-loader"], + }, + ], + }, + plugins: [ + new HtmlWebpackPlugin({ + template: "./src/index.html", + }), + // Copy Cesium Assets, Widgets, and Workers to a static directory + new CopyWebpackPlugin({ + patterns: [ + { + from: path.join(cesiumSource, "Workers"), + to: `${cesiumBaseUrl}/Workers`, + }, + { + from: path.join(cesiumSource, "ThirdParty"), + to: `${cesiumBaseUrl}/ThirdParty`, + }, + { + from: path.join(cesiumSource, "Assets"), + to: `${cesiumBaseUrl}/Assets`, + }, + { + from: path.join(cesiumSource, "Widgets"), + to: `${cesiumBaseUrl}/Widgets`, + }, + ], + }), + new webpack.DefinePlugin({ + // Define relative base path in cesium for loading assets + CESIUM_BASE_URL: JSON.stringify(cesiumBaseUrl), + }), + ], + devServer: { + static: "./dist", + }, + mode: "development", +}; diff --git a/webpack-5/.npmignore b/webpack-5/.npmignore new file mode 100644 index 00000000..f84c843d --- /dev/null +++ b/webpack-5/.npmignore @@ -0,0 +1 @@ +webpack.config.js \ No newline at end of file diff --git a/webpack-5/README.md b/webpack-5/README.md new file mode 100644 index 00000000..d880e62b --- /dev/null +++ b/webpack-5/README.md @@ -0,0 +1,105 @@ +# cesium-webpack-example + +A minimal recommended setup for an applications using [Cesium](https://cesium.com) with [Webpack 5](https://webpack.js.org/concepts/). + +## Running this application + +```sh +npm install +npm start +# for the built version +npm run build +npm run start:built +``` + +Navigate to `localhost:8080`. + +### Available scripts + +- `npm start` - Runs a webpack build with `webpack.config.js` and starts a development server at `localhost:8080` +- `npm run build` - Runs a webpack build with `webpack.config.js` +- `npm run start:built` - Start a small static server using `http-server` to demonstrate hosting the built version + +## Requiring Cesium in your application + +We recommend [importing named exports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) from the Cesium ES module, via the `import` keyword. This allows webpack to [tree shake](https://webpack.js.org/guides/tree-shaking/) your application automatically. + +### Import named modules from Cesium + +```js +import { Color } from "cesium"; +var c = Color.fromRandom(); +``` + +### Import Cesium static asset files + +```js +import "cesium/Build/Cesium/Widgets/widgets.css"; +``` + +## Cesium sub-packages + +CesiumJS requires a few static files to be hosted on your server, like web workers and SVG icons. This example is set up to copy these directories already if you install the whole `cesium` package. + +```js +new CopyWebpackPlugin({ + patterns: [ + { from: path.join(cesiumSource, "Workers"), to: `${cesiumBaseUrl}/Workers`, }, + { from: path.join(cesiumSource, "ThirdParty"), to: `${cesiumBaseUrl}/ThirdParty`, }, + { from: path.join(cesiumSource, "Assets"), to: `${cesiumBaseUrl}/Assets`, }, + { from: path.join(cesiumSource, "Widgets"), to: `${cesiumBaseUrl}/Widgets`, }, + ], +}), +``` + +However if you only install `@cesium/engine` then you should change the paths in `webpack.config.js` to the ones below: + +```js +new CopyWebpackPlugin({ + patterns: [ + { from: 'node_modules/@cesium/engine/Build/Workers', to: `${cesiumBaseUrl}/Workers` }, + { from: 'node_modules/@cesium/engine/Build/ThirdParty', to: `${cesiumBaseUrl}/ThirdParty` }, + { from: 'node_modules/@cesium/engine/Source/Assets', to: `${cesiumBaseUrl}/Assets` }, + ], +}), +``` + +## Removing pragmas + +To remove pragmas such as a traditional Cesium release build, use the [`strip-pragma-loader`](https://www.npmjs.com/package/strip-pragma-loader). + +Install the plugin with npm, + +```sh +npm install strip-pragma-loader --save-dev +``` + +and include the loader in `module.rules` with `debug` set to `false`. + +```js +rules: [ + { + test: /\.js$/, + enforce: "pre", + include: path.resolve(__dirname, cesiumSource), + use: [ + { + loader: "strip-pragma-loader", + options: { + pragmas: { + debug: false, + }, + }, + }, + ], + }, +]; +``` + +## Contributions + +Pull requests are appreciated. Please use the same [Contributor License Agreement (CLA)](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md) used for [Cesium](https://cesium.com/). + +--- + +Developed by the Cesium team. diff --git a/webpack-5/package.json b/webpack-5/package.json new file mode 100644 index 00000000..9dc39443 --- /dev/null +++ b/webpack-5/package.json @@ -0,0 +1,39 @@ +{ + "name": "cesiumjs-webpack-5-example", + "version": "1.0.0", + "description": "The minimal recommended setup for an app using Cesium with Webpack 5", + "homepage": "https://cesium.com/platform/cesiumjs/", + "license": "Apache-2.0", + "author": { + "name": "Cesium GS, Inc.", + "url": "https://cesium.com" + }, + "keywords": [ + "cesium", + "CesiumJS", + "webpack", + "example" + ], + "repository": { + "type": "git", + "url": "https://github.com/CesiumGS/cesium-webpack-example.git" + }, + "main": "index.js", + "scripts": { + "build": "webpack --config webpack.config.js", + "start": "webpack serve --config webpack.config.js", + "start:built": "npx http-server -a localhost -p 8080 dist/" + }, + "dependencies": { + "cesium": "^1.113.0" + }, + "devDependencies": { + "copy-webpack-plugin": "^9.1.0", + "css-loader": "^6.8.1", + "html-webpack-plugin": "^5.6.0", + "style-loader": "^3.3.3", + "webpack": "^5.89.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.15.1" + } +} diff --git a/webpack-5/src/.eslintrc.json b/webpack-5/src/.eslintrc.json new file mode 100644 index 00000000..e5cb154c --- /dev/null +++ b/webpack-5/src/.eslintrc.json @@ -0,0 +1,11 @@ +{ + "root": true, + "extends": ["cesium/browser"], + "plugins": ["html", "es"], + "parserOptions": { + "ecmaVersion": 2023 + }, + "rules": { + "no-unused-vars": ["error", { "vars": "all", "args": "none" }] + } +} diff --git a/webpack-5/src/css/main.css b/webpack-5/src/css/main.css new file mode 100644 index 00000000..f9433f96 --- /dev/null +++ b/webpack-5/src/css/main.css @@ -0,0 +1,9 @@ +html, +body, +#cesiumContainer { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; +} diff --git a/webpack-5/src/index.html b/webpack-5/src/index.html new file mode 100644 index 00000000..1f4d96c5 --- /dev/null +++ b/webpack-5/src/index.html @@ -0,0 +1,9 @@ + + + + + + +
+ + diff --git a/src/index.js b/webpack-5/src/index.js similarity index 96% rename from src/index.js rename to webpack-5/src/index.js index ea119311..d4958819 100644 --- a/src/index.js +++ b/webpack-5/src/index.js @@ -6,7 +6,7 @@ import { createOsmBuildingsAsync, } from "cesium"; import "cesium/Build/Cesium/Widgets/widgets.css"; -import "../src/css/main.css"; +import "./css/main.css"; // CesiumJS has a default access token built in but it's not meant for active use. // please set your own access token can be found at: https://cesium.com/ion/tokens. diff --git a/webpack.config.js b/webpack-5/webpack.config.js similarity index 97% rename from webpack.config.js rename to webpack-5/webpack.config.js index d8ac6893..cd23b5d3 100644 --- a/webpack.config.js +++ b/webpack-5/webpack.config.js @@ -1,6 +1,5 @@ "use strict"; -// The path to the CesiumJS source code const CopyWebpackPlugin = require("copy-webpack-plugin"); const path = require("path"); const webpack = require("webpack");