Arjun Barrett 4 yıl önce
ebeveyn
işleme
787306a6b5
2 değiştirilmiş dosya ile 3 ekleme ve 8 silme
  1. 0 7
      README.md
  2. 3 1
      scripts/rewriteBuilds.ts

+ 0 - 7
README.md

@@ -56,13 +56,6 @@ Note that tree shaking is completely unsupported from the CDN
 <!-- Now, the global variable fflate contains the library -->
 ```
 
-If you want to avoid using build tools entirely:
-```js
-// This should only ever be done if you have no build tools, otherwise the
-// standard ESM import is more stable.
-import * as fflate from 'fflate/esm/browser.js';
-```
-
 And use:
 ```js
 // This is an ArrayBuffer of data

+ 3 - 1
scripts/rewriteBuilds.ts

@@ -1,7 +1,8 @@
 import { readFileSync, writeFileSync, unlinkSync } from 'fs';
 import { join } from 'path';
 const atClass = /\/\*\* \@class \*\//g, pure = '/*#__PURE__*/';
-const libIndex = join(__dirname, '..', 'lib', 'index.js');
+const libDir = join(__dirname, '..', 'lib');
+const libIndex = join(libDir, 'index.js');
 writeFileSync(libIndex, readFileSync(libIndex, 'utf-8').replace(atClass, pure));
 const esmDir = join(__dirname, '..', 'esm');
 const esmIndex = join(esmDir, 'index.js'),
@@ -11,6 +12,7 @@ const esm = readFileSync(esmIndex, 'utf-8').replace(atClass, pure);
 const wk = readFileSync(esmWK, 'utf-8'),
       nwk = readFileSync(esmNWK, 'utf-8');
 unlinkSync(esmIndex), unlinkSync(esmWK), unlinkSync(esmNWK);
+unlinkSync(join(libDir, 'worker.d.ts')), unlinkSync(join(libDir, 'node-worker.d.ts'));
 const workerImport = /import wk from '\.\/node-worker';/;
 const defaultExport = /export default/;
 const constDecl = 'var wk =';