Files
rspade_system/node_modules/img-loader/__tests__/run-webpack.js
root f6fac6c4bc Fix bin/publish: copy docs.dist from project root
Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 02:08:33 +00:00

43 lines
1005 B
JavaScript
Executable File

'use strict'
var path = require('path')
var webpack = require('webpack')
var MemoryFS = require('memory-fs')
module.exports = function (entry, options) {
var compiler = webpack({
context: __dirname,
entry: entry,
output: {
path: path.resolve(__dirname),
filename: 'bundle.js'
},
mode: 'none',
module: {
rules: [{
test: /./,
use: [
{
loader: 'file-loader',
options: {
name: 'image'
}
},
{
loader: path.resolve(__dirname, '../index.js'),
options: options
}
]
}]
}
})
compiler.outputFileSystem = new MemoryFS()
return new Promise(function (resolve, reject) {
compiler.run(function (error, stats) {
if (!error && stats.compilation.errors.length) {
error = stats.compilation.errors[0]
}
return error ? reject(error) : resolve(stats.compilation.assets.image.source())
})
})
}