mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
Merge branch 'fix-esm-typescript' of https://github.com/rkuhn/konva into rkuhn-fix-esm-typescript
This commit is contained in:
commit
4328f49566
@ -1,7 +1,7 @@
|
|||||||
import FileHound from 'filehound';
|
import FileHound from 'filehound';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
const files = FileHound.create().paths('./lib').ext('js').find();
|
const files = FileHound.create().paths('./lib').ext(['js', 'ts']).find();
|
||||||
|
|
||||||
files.then((filePaths) => {
|
files.then((filePaths) => {
|
||||||
filePaths.forEach((filepath) => {
|
filePaths.forEach((filepath) => {
|
||||||
@ -22,6 +22,9 @@ files.then((filePaths) => {
|
|||||||
"import * as Canvas from 'canvas';"
|
"import * as Canvas from 'canvas';"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Handle import("./x/y/z") syntax.
|
||||||
|
text = text.replace(/(import\s*\(\s*['"])(.*)(?=['"])/g, '$1$2.js');
|
||||||
|
|
||||||
fs.writeFile(filepath, text, function (err) {
|
fs.writeFile(filepath, text, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
|
Loading…
Reference in New Issue
Block a user