/
githubmirror
/
react-beautiful-dnd
Обзор
Документация
Войти
/
githubmirror
/
react-beautiful-dnd
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
csp-server/main.js
24 строки
733 B
Alex Reardon
initial bumping
17 апр 2020, 10:14
17 апр 2020, 10:14
9186352
Код
Авторство
О чём код?
/* eslint-disable id-length */ // @flow const webpack = require('webpack'); const requireFromString = require('require-from-string'); const MemoryFS = require('memory-fs'); const path = require('path'); const config = require('./webpack.config'); const ports = require('../server-ports'); const fs = new MemoryFS(); const compiler = webpack(config); // $ExpectError compiler.outputFileSystem = fs; // $ExpectError const outputPath = compiler.compilers.find((cfg) => cfg.name === 'client') .outputPath; compiler.run(() => { const content = fs.readFileSync(path.resolve(outputPath, 'server.js')); const server = requireFromString(content.toString()).default; server(process.argv[2] || ports.cspServer, outputPath, fs); });