Skip to content

Commit

Permalink
Replace deprecated terser plugin (#1423)
Browse files Browse the repository at this point in the history
* Replace deprecated terser plugin

* Update Node version

* Fix build on windows

* Use path resolve instead of posix

---------

Co-authored-by: robo-mop <[email protected]>
  • Loading branch information
surma and aryanpingle authored Aug 19, 2024
1 parent 5f72c2e commit e8d35e0
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.15.1
20.16.0
8 changes: 4 additions & 4 deletions lib/resolve-dirs-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { posix as pathUtils, isAbsolute } from 'path';
import { posix, isAbsolute, resolve } from 'path';

export default function resolveDirs(paths) {
const pathBaseDir = paths.map((path) => [
pathUtils.basename(path),
pathUtils.dirname(path),
posix.basename(path),
posix.dirname(path),
]);

return {
Expand All @@ -31,7 +31,7 @@ export default function resolveDirs(paths) {
throw new Error(`Couldn't find ${'./' + id}`);
}
if (isAbsolute(resolveResult.id)) return resolveResult.id;
return pathUtils.resolve(resolveResult.id);
return resolve(resolveResult.id);
},
};
}
1 change: 1 addition & 0 deletions lib/simple-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default function simpleTS(mainPath, { noBuild, watch } = {}) {
await new Promise((resolve) => {
const proc = spawn(tscPath, args, {
stdio: 'inherit',
shell: true,
});

proc.on('exit', (code) => {
Expand Down
252 changes: 229 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e8d35e0

Please sign in to comment.