Skip to content

Instantly share code, notes, and snippets.

@diervo
Created December 16, 2016 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diervo/fd1fb576e40bf2b6330e04b978323ced to your computer and use it in GitHub Desktop.
Save diervo/fd1fb576e40bf2b6330e04b978323ced to your computer and use it in GitHub Desktop.
possible bug webpack - path.parse
When executing this:
__WEBPACK_IMPORTED_MODULE_0_path__["parse"])('/foo/bar/buzz.js');
^^
Script snippet #6:496 Uncaught TypeError: __webpack_require__.i(...) is not a function
__webpack_require__ being the path module, that contains all other methods (basename, extname, ...)
import { parse } from 'path';
const p = parse('/foo/bar/buzz.js');
console.log(p);
const webpack = require('webpack');
module.exports = {
entry: './test',
output: {
filename: 'test-output.js',
libraryTarget: 'this',
library: 'test'
},
node: {
fs: 'empty'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment