Skip to content

Commit 005905e

Browse files
amirehmatyasf
authored andcommitted
fix(esm): rewrite specify-commonjs-format in js
Change-Id: Ied58d18a4879f1918ce79415db372fa08f4458ab
1 parent 1bfb15f commit 005905e

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

packages/ui-scripts/lib/build/babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const {
2727
runCommandsConcurrently,
2828
getCommand
2929
} = require('@instructure/command-utils')
30-
const specifyCJSFormat = path.resolve(__dirname, 'specify-commonjs-format.sh')
30+
const specifyCJSFormat = path.resolve(__dirname, 'specify-commonjs-format.js')
3131

3232
const {
3333
BABEL_ENV,
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
3+
/*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2021 - present Instructure, Inc.
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in all
16+
* copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
* SOFTWARE.
25+
*/
26+
27+
const fs = require('fs')
28+
29+
if (!fs.existsSync('lib')) {
30+
fs.mkdirSync('lib')
31+
}
32+
33+
if (!fs.existsSync('lib/package.json')) {
34+
fs.writeFileSync('lib/package.json', '{"type":"commonjs"}\n', 'utf8')
35+
}

packages/ui-scripts/lib/build/specify-commonjs-format.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)