New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

build-modules

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-modules - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

7

buildModules.js

@@ -73,3 +73,2 @@ var fs = require('fs')

var emitter = new EventEmitter
var ignoreTheNextOne = true // ignore the first one
var compilerOrWatcher = webpack(webpackConfig, function(err, stats) {

@@ -98,7 +97,3 @@ if(err) {

if(!options.watch || !ignoreTheNextOne) {
emitter.emit('done', entrypointFileName)
} else {
ignoreTheNextOne = false // only ignore the first one
}
emitter.emit('done', entrypointFileName)
}

@@ -105,0 +100,0 @@ }

2

package.json
{
"name": "build-modules",
"version": "2.0.0",
"version": "2.0.1",
"main": "buildModules.js",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -19,4 +19,4 @@ `build-modules`

```javascript
var build = require('buildModules')
var emitter = build(__dirname+'/rootDirectory/', 'moduleName', {output:{path: __dirname+'/generatedFile/'}})
var build = require('build-modules')
var emitter = build(__dirname+'/rootDirectory/moduleName', {output:{path: __dirname+'/generatedFile/'}})
emitter.on('done', function() {

@@ -61,2 +61,7 @@ console.log("Done!")

Known issues
============
When build is called with the watch option, 'done' is emitted twice in a row on the first run. After that, you just get the expected 1 per build.
Change Log

@@ -63,0 +68,0 @@ ==========

@@ -65,11 +65,12 @@ var fs = require('fs')

this.timeout(2000)
this.count(2)
this.count(3)
var name = 'generatedTestDependency1.js'
var fileName = 'generatedTestOutput/'+name+'.umd.js'
fs.writeFileSync(__dirname+'/'+name, "exports.x = 2")
var name = 'generatedTestDependency1'
var fileName = name+'.js'
var filePath = 'generatedTestOutput/'+name+'.umd.js'
fs.writeFileSync(__dirname+'/'+fileName, "exports.x = 2")
var emitter = build(__dirname+'/'+name, {watch: true, output: {path: __dirname+'/generatedTestOutput'}, header: "//some text"})
setTimeout(function() {
console.log("AHH")
fs.writeFileSync(__dirname+'/'+name, "exports.x = 3")
fs.writeFileSync(__dirname+'/'+fileName, "exports.x = 3")
},1000)

@@ -79,9 +80,9 @@

emitter.on("done", function() {
if(time === 0) {
requirejs([fileName], function(amd) {
if(time === 0 || time === 1) { // not sure why this is called twice sometimes (for this it seems to be every time, but other builds it only happens once)
requirejs([filePath], function(amd) {
t.eq(amd.x, 2)
})
} else if(time === 1) {
requirejs.undef(fileName)
requirejs([fileName], function(amd) {
} else if(time === 2) {
requirejs.undef(filePath)
requirejs([filePath], function(amd) {
t.eq(amd.x, 3)

@@ -88,0 +89,0 @@ emitter.close() // close the watcher

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc