Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Build = require('@jupyterlab/buildutils').Build;
// Ensure a clear build directory.
var buildDir = './build';
if (fs.existsSync(buildDir)) {
fs.removeSync(buildDir);
}
fs.ensureDirSync(buildDir);
fs.copySync('./package.json', './build/package.json');
// Handle the extensions.
var jlab = package_data.jupyterlab;
var extensions = jlab.extensions;
var mimeExtensions = jlab.mimeExtensions;
Build.ensureAssets({
packageNames: Object.keys(mimeExtensions).concat(Object.keys(extensions)),
output: jlab.outputDir
});
// Create the entry point file.
var source = fs.readFileSync('index.js').toString();
var template = Handlebars.compile(source);
var data = {
jupyterlab_extensions: extensions,
jupyterlab_mime_extensions: mimeExtensions,
};
var result = template(data);
fs.writeFileSync(path.resolve(buildDir, 'index.out.js'), result);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var data = require('./package.json');
var Build = require('@jupyterlab/buildutils').Build;
var names = Object.keys(data.dependencies).filter(function (name) {
var packageData = require(name + '/package.json');
return packageData.jupyterlab !== undefined;
});
var extras = Build.ensureAssets({
packageNames: names,
output: './build'
});
module.exports = [
{
entry: ['whatwg-fetch', './index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
},
node: {
fs: 'empty'
},
bail: true,
devtool: 'source-map',
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var data = require('./package.json');
var Build = require('@jupyterlab/buildutils').Build;
var names = Object.keys(data.dependencies).filter(function(name) {
var packageData = require(name + '/package.json');
return packageData.jupyterlab !== undefined;
});
var extras = Build.ensureAssets({
packageNames: names,
output: './build'
});
module.exports = [
{
entry: ['whatwg-fetch', './index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
},
node: {
fs: 'empty'
},
bail: true,
devtool: 'cheap-source-map',
|----------------------------------------------------------------------------*/
var path = require('path');
var fs = require('fs-extra');
var Handlebars = require('handlebars');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
var Build = require('@jupyterlab/buildutils').Build;
var package_data = require('./package.json');
// Handle the extensions.
var jlab = package_data.jupyterlab;
var extensions = jlab.extensions;
var mimeExtensions = jlab.mimeExtensions;
Build.ensureAssets({
packageNames: Object.keys(mimeExtensions).concat(Object.keys(extensions)),
output: jlab.outputDir
});
fs.ensureDirSync('node_modules/codemirror/mode/prolog');
fs.copySync(path.join(path.resolve(jlab.buildDir),'../../../kernels/yap_kernel/prolog.js'), 'node_modules/codemirror/mode/prolog/prolog.js');
fs.copySync(path.join(path.resolve(jlab.buildDir),'../../../kernels/yap_kernel/meta.js'), 'node_modules/codemirror/mode/meta.js');
// Create the entry point file.
var source = fs.readFileSync('index.js').toString();
var template = Handlebars.compile(source);
var data = {
jupyterlab_extensions: extensions,
jupyterlab_mime_extensions: mimeExtensions,
};
var result = template(data);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var data = require('./package.json');
var Build = require('@jupyterlab/buildutils').Build;
var names = Object.keys(data.dependencies).filter(function(name) {
var packageData = require(name + '/package.json');
return packageData.jupyterlab !== undefined;
});
var extras = Build.ensureAssets({
packageNames: names,
output: './build'
});
module.exports = [
{
entry: ['whatwg-fetch', './index.js'],
output: {
path: __dirname + '/build',
filename: 'bundle.js'
},
node: {
fs: 'empty'
},
bail: true,
devtool: 'source-map',
// Handle the extensions.
var jlab = package_data.jupyterlab;
var extensions = jlab.extensions;
var mimeExtensions = jlab.mimeExtensions;
var packageNames = Object.keys(mimeExtensions).concat(Object.keys(extensions));
// Ensure a clear build directory.
var buildDir = plib.resolve(jlab.buildDir);
if (fs.existsSync(buildDir)) {
fs.removeSync(buildDir);
}
fs.ensureDirSync(buildDir);
// Build the assets
var extraConfig = Build.ensureAssets({
packageNames: packageNames,
output: jlab.outputDir
});
// Create the entry point file.
var source = fs.readFileSync('index.js').toString();
var template = Handlebars.compile(source);
var data = {
jupyterlab_extensions: extensions,
jupyterlab_mime_extensions: mimeExtensions
};
var result = template(data);
fs.writeFileSync(plib.join(buildDir, 'index.out.js'), result);
fs.copySync('./package.json', plib.join(buildDir, 'package.json'));
fs.copySync(
var fs = require('fs-extra');
var Handlebars = require('handlebars');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
var Visualizer = require('webpack-visualizer-plugin');
var Build = require('@jupyterlab/buildutils').Build;
var package_data = require('./package.json');
// Handle the extensions.
var jlab = package_data.jupyterlab;
var extensions = jlab.extensions;
var mimeExtensions = jlab.mimeExtensions;
var extraConfig = Build.ensureAssets({
packageNames: Object.keys(mimeExtensions).concat(Object.keys(extensions)),
output: jlab.outputDir
});
// Create the entry point file.
var source = fs.readFileSync('index.js').toString();
var template = Handlebars.compile(source);
var data = {
jupyterlab_extensions: extensions,
jupyterlab_mime_extensions: mimeExtensions
};
var result = template(data);
// Ensure a clear build directory.
var buildDir = path.resolve(jlab.buildDir);
if (fs.existsSync(buildDir)) {
var path = require('path');
var fs = require('fs-extra');
var Handlebars = require('handlebars');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
var Build = require('@jupyterlab/buildutils').Build;
var package_data = require('./package.json');
// Handle the extensions.
var jlab = package_data.jupyterlab;
var extensions = jlab.extensions;
var mimeExtensions = jlab.mimeExtensions;
Build.ensureAssets({
packageNames: Object.keys(mimeExtensions).concat(Object.keys(extensions)),
output: jlab.outputDir
});
// Create the entry point file.
var source = fs.readFileSync('index.js').toString();
var template = Handlebars.compile(source);
var data = {
jupyterlab_extensions: extensions,
jupyterlab_mime_extensions: mimeExtensions
};
var result = template(data);
// Ensure a clear build directory.
var buildDir = path.resolve(jlab.buildDir);
if (fs.existsSync(buildDir)) {
}
// Handle extensions.
['extension', 'mimeExtension'].forEach(function(item) {
var ext = jlab[item];
if (ext === true) {
ext = ''
}
if (typeof ext !== 'string') {
return;
}
corePackage.jupyterlab[item + 's'][data.name] = ext;
});
});
Build.ensureAssets({
packageNames: Object.keys(corePackage.jupyterlab.extensions),
output: '.'
});
// Write the package.json back to disk.
var text = JSON.stringify(sortPackageJson(corePackage), null, 2) + '\n';
fs.writeFileSync('./package.json', text);
var data = require('./package.json');
var Build = require('@jupyterlab/buildutils').Build;
var names = Object.keys(data.dependencies).filter(function(name) {
var packageData = require(name + '/package.json');
return packageData.jupyterlab !== undefined;
});
Build.ensureAssets({
packageNames: names,
output: './build'
});