Infinite 2D Cave Generator. This demo by @hughsk uses 7 small modules to create an explorable 2D procedurally generated cave. Click the canvas to give it focus and then use WSAD or Arrow keys to explore.
Browserify fits in well with other development tools. Check out some of the ones most commonly used with Browserify. Beefy. didact.us/beefy. Beefy is a great tool for running a development server that will automatically reload the browser and serve a newly generated bundle.js file each time you save a project file. grunt-browserify. github.com ...
I was also getting these error's when upgrading from webpack v4 to v5.
Resolved by making the following changes to webpack.config.js
added resolve.fallback property
removed node property
{
resolve: {
modules: [...],
fallback: {
"fs": false,
"tls": false,
"net": false,
"path": false,
"zlib": false,
"http": false,
"https": false,
"stream": false,
"crypto": false,
"crypto-browserify": require.resolve('crypto-browserify'), //if you want to use this module also don't forget npm i crypto-browserify
}
},
entry: [...],
output: {...},
module: {
rules: [...]
},
plugins: [...],
optimization: {
minimizer: [...],
},
// node: {
// fs: 'empty',
// net: 'empty',
// tls: 'empty'
// },
}
upgrade from v4 to v5 => https://webpack.js.org/migrate/5/#clean-up-configuration
I ran into this problem after upgrading to Angular 12, so after searching I ended up doing the following:
In tsconfig.json I added:
{
"compilerOptions": {
"paths":{
"crypto":["node_modules/crypto-js"]
}
}
}
And in angular.json I added:
{
"architect": {
"build": {
"options": {
"allowedCommonJsDependencies": ["crypto"], // note that this is the key of --> "crypto":["node_modules/crypto-js"]"
}
}
}
}
And the warnings are gone. I hope this will help you out.
You can achieve that by using browserify-shim. Assuming that you've got a module named that depends on jQuery in the global scope with the following contents:mymodule.js
var $ = require('jQuery');
console.log(typeof $);
Install browserify-shim:
npm install browserify-shim --save-dev
In package.json file, tell browserify to use browserify-shim as a transform:
{
"browserify": {
"transform": [ "browserify-shim" ]
}
}
In package.json file, tell browserify-shim to map jQuery to the jQuery in the global scope:
{
"browserify-shim": {
"jQuery": "global:jQuery"
}
}
Run browserify
browserify mymodule.js > bundle.js
If you examine bundle.js you will notice that is replaced with require('jQuery').(window.jQuery)
Installing an npm module like allows you to use browserify as a command on the command line. To use the module within your project's code, you must install the module as a dependency. In other words, yes, is must be installed locally within the project's browserify folder and referenced in the ./node_modules file.package.json
From the npm documentation:
- Local install (default): puts stuff in
of the current package root../node_modules- Global install (with
): puts stuff in-gor wherever node is installed./usr/local- Install it locally if you're going to
it.require()- Install it globally if you're going to run it on the command line.
- If you need both, then install it in both places, or use
.npm link