-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(atomic): deploy loader to the CDN
- Loading branch information
1 parent
f42d055
commit 1ba3b64
Showing
8 changed files
with
35 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {promises as fs} from 'fs'; | ||
import path from 'path'; | ||
|
||
const files = [ | ||
path.resolve('src/components/stencil-generated/commerce/index.ts'), | ||
path.resolve('src/components/stencil-generated/search/index.ts'), | ||
]; | ||
|
||
const oldImport = | ||
"import { defineCustomElements } from '@coveo/atomic/dist/loader';"; | ||
const newImport = | ||
"import { defineCustomElements } from '@coveo/atomic/loader';"; | ||
|
||
const updateFiles = async () => { | ||
await Promise.all( | ||
files.map(async (filePath) => { | ||
try { | ||
let data = await fs.readFile(filePath, 'utf8'); | ||
const updatedData = data.replace(oldImport, newImport); | ||
await fs.writeFile(filePath, updatedData, 'utf8'); | ||
console.log(`File updated: ${filePath}`); | ||
} catch (err) { | ||
console.error(`Error updating file: ${filePath}`, err); | ||
} | ||
}) | ||
); | ||
}; | ||
|
||
updateFiles(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters