Skip to content

Commit

Permalink
fix: resolve path posix export
Browse files Browse the repository at this point in the history
Based on calvinmetcalf/rollup-plugin-node-builtins#33

Another way of solving that is using the following patch:

```
--- node_modules/rollup-plugin-node-builtins/src/es6/path.js
+export var posix = {
+  relative: relative,
+  join: join,
+  isAbsolute: isAbsolute,
+  normalize: normalize,
+  resolve: resolve
+};
 export default {
```
  • Loading branch information
opichals committed Mar 1, 2020
1 parent 49a3012 commit bacfbcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions libs/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "MIT",
"dependencies": {
"memfs": "=2.12.1",
"path-browserify": "^1.0.0",
"rollup": "^1.32.0",
"rollup-plugin-espruino-modules": "^0.5.0"
},
Expand Down
19 changes: 7 additions & 12 deletions libs/rollup/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ const buildPlugins = opts => [
];


// Requires the following patch:
//
// --- node_modules/rollup-plugin-node-builtins/src/es6/path.js
// +export var posix = {
// + relative: relative,
// + join: join,
// + isAbsolute: isAbsolute,
// + normalize: normalize,
// + resolve: resolve
// +};
// export default {

const config = {
input : 'espruino-rollup.js',
output : {
Expand All @@ -45,6 +33,7 @@ const config = {
alias({
entries: {
rollup: require.resolve('rollup/dist/rollup.browser'),
path: require.resolve('path-browserify'),
fs: require.resolve('memfs'),
debug: require.resolve('./debug-shim')
}
Expand All @@ -55,6 +44,12 @@ const config = {
},
commonjs: {
namedExports: {
'node_modules/path-browserify/index.js': [
'dirname', 'basename', 'extname',
'normalize', 'resolve',
'sep',
'posix',
],
'node_modules/memfs/lib/index.js': [
'existsSync',
'statSync', 'lstatSync', 'realpathSync',
Expand Down

0 comments on commit bacfbcb

Please sign in to comment.