-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible with webpack #59
Comments
Temporary workaround in webpack.config.js using string-replace-webpack-plugin, inspired by webpack/webpack#138 (comment) var StringReplacePlugin = require('string-replace-webpack-plugin');
...
test: /validate.js$/,
include: /node_modules\/json-schema/,
loader: StringReplacePlugin.replace({ // from the 'string-replace-webpack-plugin'
replacements: [{
pattern: /\(\{define:typeof define!="undefined"\?define:function\(deps, factory\)\{module\.exports = factory\(\);\}\}\)\./ig,
replacement: function(match, p1, offset, string) {
return false;
}
}]
})
...
plugins: [
...
new StringReplacePlugin()
], |
Just spent three hours tracking this exact problem down. Webpack is widely used it would be great if this code supported it straight out of the box. jsprim and ms-rest-azure are also broken due to this dependency TritonDataCenter/node-jsprim#13 Any chance this can be fixed? It's a showstopper for using other packages. thanks |
The outcome is still that Azure is broken with Webpack. Azure say its not their problem, Webpack seem to think everyone else needs to make their packages compatible with it instead of the other way around, and the guy behind the json-schema package appears to have no interest in making his package to work with webpack. It's a mexican standoff in which no-one wants to do what it takes to make their software work with each other. Azure/autorest#734 What can be done? |
Read here for details: * kriszyp/json-schema#59 * webpack/webpack#2101 Used a fix mentioned here: * webpack/webpack#138 Works for now…
lol, this is affecting us in PouchDB too (pouchdb/pouchdb#5312). Is it still a Mexican standoff if there are four of us? 😛 |
I'm also having this problem... any work around ? |
still same issue |
could you also release it, and not just fix it? |
@ForsakenHarmony why so many big name packages depend on json-schema |
ask them, not me |
please release the fix |
Pushed a tag and npm publish. |
Close issue? Seems fine now. |
Due to the way in which AMD is tested for in validate.js, this module is incompatible with webpack. When built in a webpack environment, it causes this error:
I suggest switching to a more standard module test, such as UMD.
The text was updated successfully, but these errors were encountered: