Skip to content
Snippets Groups Projects
Commit ce0f8a95 authored by Yadd's avatar Yadd
Browse files

Build commonjs files using mjs2cjs

parent a32306cd
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ Uploaders: Pirate Praveen <praveen@debian.org>
Build-Depends: debhelper-compat (= 13)
, dh-sequence-nodejs
, node-tape <!nocheck>
, rollup
Standards-Version: 4.6.0
Vcs-Browser: https://salsa.debian.org/js-team/node-strip-eof
Vcs-Git: https://salsa.debian.org/js-team/node-strip-eof.git
......
Description: export commonjs files
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2022-03-31
--- a/package.json
+++ b/package.json
@@ -10,8 +10,12 @@
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
- "type": "module",
- "exports": "./index.js",
+ "main": "./index.cjs",
+ "module": "./index.js",
+ "exports": {
+ "import": "./index.js",
+ "require": "./index.cjs"
+ },
"engines": {
"node": ">=12"
},
@@ -19,6 +23,7 @@
"test": "xo && ava"
},
"files": [
+ "index.cjs",
"index.js"
],
"keywords": [
Description: replace ava by tape
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2022-03-30
Last-Update: 2022-03-31
--- a/test.js
+++ b/test.js
@@ -1,4 +1,4 @@
@@ -1,5 +1,5 @@
-import test from 'ava';
+import test from 'tape';
import stripFinalNewline from './index.js';
-import stripFinalNewline from './index.js';
+const test = require('tape');
+const stripFinalNewline = require('./');
test('string', t => {
t.is(stripFinalNewline('foo\n'), 'foo');
@@ -8,6 +8,7 @@
t.is(stripFinalNewline('foo\r\n'), 'foo');
t.is(stripFinalNewline('foo\r'), 'foo');
......
replace-ava-by-tape.patch
export-commonjs.patch
......@@ -6,3 +6,6 @@
%:
dh $@
override_dh_auto_build:
mjs2cjs index.js
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment