glass-easel-miniprogram-webpack-plugin 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintignore ADDED
@@ -0,0 +1,6 @@
1
+ /node_modules
2
+ /dist
3
+ /docs
4
+ /coverage
5
+ /index.js
6
+ /helpers.js
package/README.md CHANGED
@@ -7,3 +7,17 @@ Refer to the [glass-easel](https://github.com/wechat-miniprogram/glass-easel) pr
7
7
  ## Usage
8
8
 
9
9
  See the [template](../glass-easel-miniprogram-template/).
10
+
11
+ ## Custom Bootstrap
12
+
13
+ By default, the plugin inserts a bootstrap code to insert the `defaultEntry` into DOM `<body>` 。
14
+
15
+ However, if the backend is not DOM or you want to bootstrap manually, set the `customBootstrap` option to `true` .
16
+
17
+ ```js
18
+ new GlassEaselMiniprogramWebpackPlugin({
19
+ customBootstrap: true,
20
+ })
21
+ ```
22
+
23
+ Furthermore, if the backend handles stylesheets unlike DOM, another `disableClassPrefix` may be required to be `true` depending on the backend.
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
 
3
- exports.escapeJsString = (str) =>
3
+ export const escapeJsString = (str: string) =>
4
4
  str.replace(/["'\\\r\n`]/g, (c) => {
5
5
  if (c === '\r') return '\\r'
6
6
  if (c === '\n') return '\\n'