Skip to content

Commit ad0944e

Browse files
committed
Fix NodeNext module resolution
1 parent eab24d9 commit ad0944e

File tree

8 files changed

+21
-22
lines changed

8 files changed

+21
-22
lines changed

dist/npm-to-yarn.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/npm-to-yarn.cjs renamed to dist/npm-to-yarn.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
var unchangedCLICommands = ['test', 'login', 'logout', 'link', 'publish', 'cache'];
42
var yarnCLICommands = [
53
'init',
@@ -260,5 +258,5 @@ function yarnToNPM(m, command) {
260258
}
261259
}
262260

263-
module.exports = convert;
264-
//# sourceMappingURL=npm-to-yarn.cjs.map
261+
export { convert as default };
262+
//# sourceMappingURL=npm-to-yarn.mjs.map

dist/npm-to-yarn.cjs.map renamed to dist/npm-to-yarn.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/npm-to-yarn.js renamed to dist/npm-to-yarn.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/npm-to-yarn.umd.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
"documentation",
88
"yarn to npm"
99
],
10-
"main": "dist/npm-to-yarn.cjs",
11-
"module": "dist/npm-to-yarn.js",
10+
"main": "dist/npm-to-yarn.umd.js",
11+
"module": "dist/npm-to-yarn.mjs",
1212
"typings": "dist/types/index.d.ts",
1313
"exports": {
1414
".": {
1515
"types": "./dist/types/index.d.ts",
16-
"import": "./dist/npm-to-yarn.js",
17-
"require": "./dist/npm-to-yarn.cjs"
16+
"import": "./dist/npm-to-yarn.mjs",
17+
"require": "./dist/npm-to-yarn.umd.js",
18+
"default": "./dist/npm-to-yarn.umd.js"
1819
}
1920
},
2021
"sideEffects": false,
@@ -34,12 +35,12 @@
3435
"engines": {
3536
"node": ">=6.0.0"
3637
},
37-
"type": "module",
38+
"type": "commonjs",
3839
"scripts": {
3940
"lint": "eslint src/*.ts test/*.spec.ts --ext .js,.ts",
4041
"prebuild": "rimraf dist",
41-
"build": "tsc --module es6 && rollup -c rollup.config.js",
42-
"start": "rollup -c rollup.config.js -w",
42+
"build": "tsc --module es6 && rollup -c rollup.config.mjs",
43+
"start": "rollup -c rollup.config.mjs -w",
4344
"test": "jest --coverage",
4445
"test:watch": "jest --coverage --watch",
4546
"test:prod": "npm run lint && npm run test -- --no-cache",

rollup.config.js renamed to rollup.config.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ export default [
55
input: 'src/index.ts', // todo: use rollup-plugin-replace
66
output: [
77
{
8-
file: 'dist/npm-to-yarn.js',
9-
format: 'umd',
8+
file: 'dist/npm-to-yarn.mjs',
9+
format: 'es',
1010
name: 'n2y',
1111
sourcemap: true,
1212
},
1313
{
14-
file: 'dist/npm-to-yarn.cjs',
15-
format: 'cjs',
14+
file: 'dist/npm-to-yarn.umd.js',
15+
format: 'umd',
1616
name: 'n2y',
1717
sourcemap: true,
1818
},

test.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
1111
/>
1212
<meta name="description" content="Test out Squirrelly code in the browser here" />
13-
<script src="./dist/npm-to-yarn.js"></script>
13+
<script src="./dist/npm-to-yarn.umd.js"></script>
1414
<style>
1515
body {
1616
background-color: #f4f4f4;
@@ -148,7 +148,7 @@ <h2>
148148
>
149149
</h2>
150150
<div id="samples">
151-
<div style="clear:both;height:10px"></div>
151+
<div style="clear: both; height: 10px"></div>
152152
<div class="templategroup">
153153
<h4>NPM</h4>
154154
<textarea autocomplete="off" id="npm-text">
@@ -166,13 +166,13 @@ <h4>Yarn</h4>
166166
<script>
167167
/* global Sqrl */
168168
window.onload = function () {
169-
function npmToYarn () {
169+
function npmToYarn() {
170170
console.clear()
171171
var npmText = document.getElementById('npm-text').value
172172
document.getElementById('yarn-text').value = n2y(npmText, 'yarn')
173173
}
174174

175-
function yarnToNpm () {
175+
function yarnToNpm() {
176176
console.clear()
177177
var yarnText = document.getElementById('yarn-text').value
178178
document.getElementById('npm-text').value = n2y(yarnText, 'npm')

0 commit comments

Comments
 (0)