Skip to content
This repository was archived by the owner on May 23, 2021. It is now read-only.

Commit 8d34452

Browse files
authoredOct 19, 2019
feat(build): support NO_INLINE (#37)
* feat(build): support NO_INLINE * chore: Boolean cast

File tree

4 files changed

+243
-179
lines changed

4 files changed

+243
-179
lines changed
 

‎README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ Build source codes in `src/` and output to `lib/`.
2828

2929
It is built by [Babel](https://babeljs.io/) with [`env` preset](https://babeljs.io/docs/plugins/preset-env/).
3030

31-
Additionally, build command inline [Node fs calls](https://nodejs.org/api/fs.html) with [babel-plugin-static-fs](https://github.com/Jam3/babel-plugin-static-fs) for browser compatibility.
31+
Additionally, `build` command inline [Node fs calls](https://nodejs.org/api/fs.html) with [babel-plugin-static-fs](https://github.com/Jam3/babel-plugin-static-fs) for browser compatibility.
32+
33+
:memo: Disable inlining by `$ NO_INLINE=1 textlint-scripts build`.
3234

3335
### `textlint-scripts test`
3436

‎configs/babel.config.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require("fs");
22
const paths = require("../configs/paths");
33
const useTypeScript = fs.existsSync(paths.appTsConfig);
4+
const NO_INLINE = !!process.env.NO_INLINE;
45
module.exports = {
56
presets: [
67
[
@@ -14,8 +15,10 @@ module.exports = {
1415
}
1516
]
1617
].concat(useTypeScript ? [["@babel/preset-typescript"]] : []),
17-
plugins: [
18-
// inline fs content
19-
"static-fs"
20-
]
18+
plugins: NO_INLINE
19+
? []
20+
: [
21+
// inline fs content
22+
"static-fs"
23+
]
2124
};

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"babel-plugin-static-fs": "^3.0.0",
4848
"confirmer": "^1.1.2",
4949
"cross-spawn": "^7.0.1",
50-
"mocha": "^6.2.1",
50+
"mocha": "^6.2.2",
5151
"pkg-to-readme": "^1.1.0",
5252
"textlint-tester": "^5.1.10"
5353
},

‎yarn.lock

+232-173
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
This repository has been archived.