PSON
PSON copied to clipboard
Webpack: Critical dependency: the request of a dependency is an expression
pson/index.js
May be problem here.
var path = require("path"),
PSON = require(path.join(__dirname, "dist", "PSON.js"));
webpack:
17:11-59 Critical dependency: the request of a dependency is an expression
@ ./node_modules/pson/index.js
Does not allow to compile projects with webpack / browserify because of the calculated dependency. On client: Uncaught Error: Cannot find module "."
How to deal with this?
Need example repo?
Should probably be changed to a relative path then. Feels like this repo was created before webpack became a thing :)
In case anyone else ends up here, this simple tweak to webpack.config.js
solved the problem for me:
resolve: {
alias: {
pson: 'pson/dist/PSON.js',
},
},