From 619792e004c0c34ca70e13adf0b00df3131760d3 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 24 Feb 2017 14:23:29 +0000 Subject: [PATCH] add public files js css and images copied in the demo shell dist (#1649) --- demo-shell-ng2/README.md | 22 ++++++++++++++-- demo-shell-ng2/config/webpack.common.js | 34 ++++++------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/demo-shell-ng2/README.md b/demo-shell-ng2/README.md index 71c30b239a..0fd4b3ee69 100644 --- a/demo-shell-ng2/README.md +++ b/demo-shell-ng2/README.md @@ -26,7 +26,7 @@ npm install npm start ``` -This command compiles and starts the project in watch mode. +This command compiles and starts the project in watch mode. Browser will automatically reload upon changes. Upon start you can navigate to `http://localhost:3000` with your preferred browser. @@ -41,7 +41,7 @@ npm run build npm run start:dist ``` -This command builds broject in `production` mode. +This command builds broject in `production` mode. All output is placed to `dist` folder and can be served your preferred web server. You should need no additional files outside the `dist` folder. @@ -81,4 +81,22 @@ Directory structure: │ └── fr.json ``` +## Custom-files +If you need to add custom files on your project you can add this files in the folders + +``` +. +├── public/ +│ ├── images/ +│ ├── css/ +│ └── js/ +``` + +those folder above wil be copied in the root of your project and you can refer to them for example as + + * './images/custom_image.png' + * './js/custom_script.js' + * './css/custom_style.css' + +for more complex scenario you need to modify the webpack file in the config folder. \ No newline at end of file diff --git a/demo-shell-ng2/config/webpack.common.js b/demo-shell-ng2/config/webpack.common.js index fb5bc51860..bac7384626 100644 --- a/demo-shell-ng2/config/webpack.common.js +++ b/demo-shell-ng2/config/webpack.common.js @@ -159,40 +159,22 @@ module.exports = { to: 'js/material.min.js', flatten: true }, { - context: 'public', - from: 'css/material.orange-blue.min.css', - to: 'css/material.orange-blue.min.css', - flatten: true - }, { context: 'node_modules', from: 'material-design-icons/iconfont/', to: 'css/iconfont/', flatten: true }, { context: 'public', - from: 'js/typedarray.js', - to: 'js/typedarray.js', - flatten: true + from: 'js/', + to: 'js/' + },{ + context: 'public', + from: 'css/', + to: 'css/' }, { context: 'public', - from: 'js/Blob.js', - to: 'js/Blob.js', - flatten: true - }, { - context: 'public', - from: 'js/formdata.js', - to: 'js/formdata.js', - flatten: true - }, { - context: 'public', - from: 'js/promisePolyfill.js', - to: 'js/promisePolyfill.js', - flatten: true - }, { - context: 'public', - from: 'css/muli-font.css', - to: 'css/muli-font.css', - flatten: true + from: 'images/', + to: 'images/' } ]),