diff --git a/build/index.esm.js b/build/index.esm.js new file mode 100644 index 0000000..ac66a81 --- /dev/null +++ b/build/index.esm.js @@ -0,0 +1,6 @@ +const addToHistoryN = n => (value, old) => [value, ...old.filter(h => h !== value).slice(0, n - 1)]; + +const addToHistory = addToHistoryN(10); + +export { addToHistoryN, addToHistory }; +//# sourceMappingURL=index.esm.js.map diff --git a/build/index.esm.js.map b/build/index.esm.js.map new file mode 100644 index 0000000..fe6285a --- /dev/null +++ b/build/index.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.esm.js","sources":["../src/history/index.js"],"sourcesContent":["export const addToHistoryN = n => (value, old) => [value, ...old.filter(h => h !== value).slice(0, n - 1)]\n\nexport const addToHistory = addToHistoryN(10)"],"names":[],"mappings":"AAAO,MAAM,aAAa,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAC;;AAE1G,AAAO,MAAM,YAAY,GAAG,aAAa,CAAC,EAAE;;;;"} \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map deleted file mode 100644 index 3b889ed..0000000 --- a/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/history/index.js"],"sourcesContent":["export const addToHistoryN = n => (value, old) => [value, ...old.filter(h => h !== value).slice(0, n - 1)]\n\nexport const addToHistory = addToHistoryN(10)"],"names":[],"mappings":";;;;;;AAAO,MAAM,aAAa,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAC;;AAE1G,AAAO,MAAM,YAAY,GAAG,aAAa,CAAC,EAAE;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/build/index.js b/build/index.umd.js similarity index 93% rename from build/index.js rename to build/index.umd.js index 95792a5..77b34d2 100644 --- a/build/index.js +++ b/build/index.umd.js @@ -14,4 +14,4 @@ exports.addToHistory = addToHistory; Object.defineProperty(exports, '__esModule', { value: true }); }))); -//# sourceMappingURL=index.js.map +//# sourceMappingURL=index.umd.js.map diff --git a/build/index.umd.js.map b/build/index.umd.js.map new file mode 100644 index 0000000..f085366 --- /dev/null +++ b/build/index.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.umd.js","sources":["../src/history/index.js"],"sourcesContent":["export const addToHistoryN = n => (value, old) => [value, ...old.filter(h => h !== value).slice(0, n - 1)]\n\nexport const addToHistory = addToHistoryN(10)"],"names":[],"mappings":";;;;;;AAAO,MAAM,aAAa,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAC;;AAE1G,AAAO,MAAM,YAAY,GAAG,aAAa,CAAC,EAAE;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/package.json b/package.json index 5581d93..67db20e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "axcess-common", "version": "1.0.1", "description": "Axcess common modules", - "main": "build/index.js", + "main": "build/index.umd.js", + "module": "build/index.esm.js", "scripts": { "test": "jest" }, @@ -25,8 +26,8 @@ }, "husky": { "hooks": { - "pre-commit": "npm test", - "pre-push": "npm version patch && ./node_modules/.bin/rollup -c rollup.config.js" + "pre-commit": "./node_modules/.bin/rollup -c rollup.config.js && npm test", + "pre-push": "npm version patch" } } } diff --git a/rollup.config.js b/rollup.config.js index a826684..a16e654 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,9 +1,13 @@ export default { input: 'src/index.js', - output: { - file: 'build/index.js', + output: [{ + file: 'build/index.umd.js', format: 'umd', name: 'axcessCommon', - sourcemap: true - } -} \ No newline at end of file + }, + { + file: 'build/index.esm.js', + format: 'es', + }], + sourcemap: true +} diff --git a/src/history/index.spec.js b/src/history/index.spec.js index c5da431..b89e135 100644 --- a/src/history/index.spec.js +++ b/src/history/index.spec.js @@ -1,4 +1,4 @@ -const {addToHistoryN, addToHistory} = require('../../build/index') +const {addToHistoryN, addToHistory} = require('../../build/index.umd') describe('History', () => { describe('history builder', () => {