From 726e53657bc9b684deb61373ff521c9ce8d26970 Mon Sep 17 00:00:00 2001 From: Mizok Date: Sat, 16 Apr 2022 23:05:17 +0800 Subject: [PATCH] fix some font files Content Security Policy problem / add js files mode detection --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b08e82d..fbf26d0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ title: webpack-template date: author: Mizok -version: 0.6.0 +version: 0.7.0 tags: --- @@ -51,12 +51,19 @@ On the other hand, if you want your output page name to be `index.html`,and usin - an `main.ts` file in `./src/ts` - an `main.scss` file in `./src/scss` -### I want to get webpack `mode` environment argument in `ejs` file, how can I make this? +### I want to get webpack `mode` environment argument in `ejs` and `js` files, how can I make this? Like this (in your `ejs` file) : ```ejs -
<%= mode%>
+ +
<%= mode%>
+``` + +And this (in your `js` file) : + +```javascript +console.log(PROCESS.MODE) // this will output development|production ``` ### My `img` tag is not showing because `webpack` seems to get my `src` wrong.