Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bs-loader

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs-loader - npm Package Compare versions

Comparing version 1.5.5 to 1.5.6

2

examples/es6/webpack.config.js

@@ -15,3 +15,3 @@ const path = require('path')

{
loader: './bs-loader',
loader: 'bs-loader',
options: {

@@ -18,0 +18,0 @@ module: 'es6'

@@ -8,3 +8,3 @@ const path = require('path')

try {
bsb = require.resolve('bs-platform/bin/bsb')
bsb = require.resolve('bs-platform/bin/bsb.exe')
} catch (e) {

@@ -15,7 +15,13 @@ bsb = 'bsb'

const outputDir = 'lib'
const CWD = process.cwd()
const fileNameRegex = /\.(ml|re)$/
const es6ReplaceRegex = /(from\ "\.\.?\/.*)(\.js)("\;)/g
const commonJsReplaceRegex = /(require\("\.\.?\/.*)(\.js)("\);)/g
const getErrorRegex = /(File [\s\S]*?:\n|Fatal )[eE]rror: [\s\S]*?(?=ninja|\n\n|$)/g
const getJsFile = (moduleDir, resourcePath) => {
const mlFileName = resourcePath.replace(process.cwd(), '')
const jsFileName = mlFileName.replace(/\.(ml|re)$/, '.js')
return path.join(process.cwd(), outputDir, moduleDir, jsFileName)
const mlFileName = resourcePath.replace(CWD, '')
const jsFileName = mlFileName.replace(fileNameRegex, '.js')
return path.join(CWD, outputDir, moduleDir, jsFileName)
}

@@ -25,4 +31,4 @@

moduleDir === 'es6'
? src.replace(/(from\ "\.\.?\/.*)(\.js)("\;)/g, '$1$3')
: src.replace(/(require\("\.\.?\/.*)(\.js)("\);)/g, '$1$3')
? src.replace(es6ReplaceRegex, '$1$3')
: src.replace(commonJsReplaceRegex, '$1$3')

@@ -37,7 +43,7 @@ const runBsb = (compilation, callback) => {

const runBsbSync = () => {
execFileSync(bsb, ['-make-world'], { stdio: 'pipe' })
const cp = execFileSync(bsb, ['-make-world'], { stdio: 'pipe' })
cp.stdin.end()
}
const getBsbErrorMessages = err =>
err.match(/(File [\s\S]*?:\n|Fatal )[eE]rror: [\s\S]*?(?=ninja|\n\n|$)/g)
const getBsbErrorMessages = err => err.match(getErrorRegex)

@@ -93,7 +99,7 @@ const getCompiledFile = (compilation, moduleDir, path, callback) => {

errorMessages
.slice(0, -1)
.forEach(msg => this.emitError(new Error(msg)))
for (let i = 0; i < errorMessages.length - 1; ++i) {
this.emitError(new Error(errorMessages[i]))
}
callback(new Error(errorMessages.slice(-1)), null)
callback(new Error(errorMessages[errorMessages.length - 1]), null)
} else {

@@ -100,0 +106,0 @@ callback(null, res)

{
"name": "bs-loader",
"version": "1.5.5",
"version": "1.5.6",
"description": "Bucklescript integration in Webpack",

@@ -5,0 +5,0 @@ "main": "index.js",

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