-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'serve' script to use webpack-serve to host sample app locally
- Loading branch information
SequoiaBuild
committed
Aug 8, 2018
1 parent
a5fa638
commit aceff72
Showing
5 changed files
with
19 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/release/ | ||
/node_modules/ | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# dojo-webpack-plugin-sample | ||
|
||
[Sample application](https://openntf.github.io/dojo-webpack-plugin-sample/test.html) demonstrating the use of [dojo-webpack-plugin](https://github.com/OpenNTF/dojo-webpack-plugin) with [webpack](https://webpack.github.io/). The sample can be run as a webpack application (the default) or as an [unpacked application](https://openntf.github.io/dojo-webpack-plugin-sample/test.html?nopack=1) that uses the Dojo loader by specifying the ?nopack=1 query arg in the URL. It demonstrates how to construct a [Dojo loader config](https://github.com/OpenNTF/dojo-webpack-plugin-sample/blob/master/js/loaderConfig.js) that can be used in both weback and non-webpack versions of a Dojo application. You may want to support non-webpack versions during the development phase of your application in order to avoid build overhead during development. | ||
[Sample application](https://openntf.github.io/dojo-webpack-plugin-sample/test.html) demonstrating the use of [dojo-webpack-plugin](https://github.com/OpenNTF/dojo-webpack-plugin) with [webpack](https://webpack.github.io/). The sample can be run as a webpack application (the default) or as an [unpacked application](https://openntf.github.io/dojo-webpack-plugin-sample/test.html?nopack=1) that uses the native Dojo loader by specifying the ?nopack=1 query arg in the URL. It demonstrates how to construct a [Dojo loader config](https://github.com/OpenNTF/dojo-webpack-plugin-sample/blob/master/js/loaderConfig.js) that can be used in both weback and non-webpack versions of a Dojo application. You may want to support non-webpack versions during the development phase of your application in order to avoid build overhead during development. | ||
|
||
``` | ||
npm install | ||
npm run build | ||
npm run [build|serve] | ||
``` | ||
|
||
The built files will be located in `./release`. You can launch the app by loading `./test.html` in a browser. Note that loading the app from the file system works only for the packed application. The non-packed version of the app (?nopack=1) loads Dojo from a CDN, so cross-origin restrictions in browsers require that you load the non-packed app from an http server. Alternatively, you could modify test.html and js/loaderConfig.js to use the locally installed Dojo for the unpacked application as well. | ||
The `build` script builds the sample application, placing the deployable artifacts in the `release` directory. The `serve` script builds the sample application and uses [webpack-serve](https://www.npmjs.com/package/webpack-serve) to host the application locally at http://localhost:8080/test.html. It automatically launches a browser to load and run the application. | ||
|
||
[@GordonSmith](https://github.com/GordonSmith) provides a fork of the sample app with some variations in [here](https://github.com/OpenNTF/dojo-webpack-plugin-sample/issues/40). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
devMiddleware: { | ||
publicPath: "/release/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters