lincd-cli 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +24 -23
  2. package/defaults/defaultModule/Index.tsx +24 -24
  3. package/defaults/defaultModule/index.ts +1 -1
  4. package/defaults/defaultModule/ontology.ts +1 -1
  5. package/defaults/index.ts +1 -1
  6. package/defaults/module/Gruntfile.js +16 -0
  7. package/defaults/module/package.json +29 -0
  8. package/defaults/module/src/components/ExampleComponent.tsx +22 -0
  9. package/defaults/module/src/data/example-ontology.json +20 -0
  10. package/defaults/module/src/data/example-ontology.json.d.ts +1 -0
  11. package/defaults/module/src/index.ts +7 -0
  12. package/defaults/module/src/module.ts +9 -0
  13. package/defaults/module/src/ontologies/example-ontology.ts +33 -0
  14. package/defaults/module/src/shapes/ExampleShapeClass.ts +30 -0
  15. package/defaults/module/tsconfig-es5.json +19 -0
  16. package/defaults/module/tsconfig.json +19 -0
  17. package/defaults/ontology.ts +1 -1
  18. package/defaults/package.json +28 -24
  19. package/defaults/site/.gitignore +8 -0
  20. package/defaults/site/.npmignore +10 -0
  21. package/defaults/site/lib/start-server.js +22 -0
  22. package/defaults/site/lib/test-server.js +10 -0
  23. package/defaults/site/package.json +40 -0
  24. package/defaults/site/storage/filestores/settings-development.jsonld +117 -0
  25. package/defaults/site/storage/filestores/settings-production-template.jsonld +129 -0
  26. package/defaults/site/web/.htaccess +19 -0
  27. package/defaults/site/web/favicon.png +0 -0
  28. package/defaults/site/web/img/placeholder.jpg +0 -0
  29. package/defaults/tsconfig-es5.json +18 -19
  30. package/defaults/tsconfig.json +20 -21
  31. package/lib/cli.js +1074 -0
  32. package/lib/config-grunt.js +254 -0
  33. package/lib/config-webpack.js +273 -0
  34. package/{index.js → lib/index.js} +8 -4
  35. package/lib/interfaces.js +2 -0
  36. package/{plugins → lib/plugins}/declaration-plugin.js +3 -3
  37. package/lib/plugins/externalise-modules.js +165 -0
  38. package/{plugins → lib/plugins}/watch-run.js +0 -0
  39. package/lib/utils.js +127 -0
  40. package/package.json +71 -68
  41. package/{cli.js → src/cli.js} +54 -93
  42. package/src/config-grunt.js +263 -0
  43. package/src/config-webpack.js +281 -0
  44. package/src/index.js +22 -0
  45. package/src/interfaces.js +2 -0
  46. package/src/plugins/declaration-plugin.js +248 -0
  47. package/{plugins → src/plugins}/externalise-modules.js +8 -6
  48. package/src/plugins/shapes-plugin.js +69 -0
  49. package/src/plugins/watch-run.js +47 -0
  50. package/src/utils.js +127 -0
  51. package/config-generator.js +0 -545
  52. package/utils.js +0 -17
@@ -1,545 +0,0 @@
1
- "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
3
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4
- to[j] = from[i];
5
- return to;
6
- };
7
- exports.__esModule = true;
8
- exports.generateWebpackConfig = exports.setupGrunt = void 0;
9
- var declaration_plugin_1 = require("./plugins/declaration-plugin");
10
- var externalise_modules_1 = require("./plugins/externalise-modules");
11
- var watch_run_1 = require("./plugins/watch-run");
12
- var colors = require("colors");
13
- var utils_1 = require("./utils");
14
- var fs = require('fs');
15
- var MiniCssExtractPlugin = require('mini-css-extract-plugin');
16
- var chalk = require('chalk');
17
- var webpack = require('webpack');
18
- var path = require('path');
19
- var ExtractTextPlugin = require('extract-text-webpack-plugin');
20
- var WebpackLicencePlugin = require('webpack-license-plugin');
21
- var TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
22
- var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
23
- var TerserPlugin = require('terser-webpack-plugin');
24
- var exec = require('child_process').exec;
25
- var NODE_ENV = process.env.NODE_ENV;
26
- var nodeProduction = NODE_ENV == 'production';
27
- var libraryName = 'lincd';
28
- function log() {
29
- var messages = [];
30
- for (var _i = 0; _i < arguments.length; _i++) {
31
- messages[_i] = arguments[_i];
32
- }
33
- messages.forEach(function (message) {
34
- console.log(chalk.cyan(message));
35
- });
36
- }
37
- function debug(config) {
38
- var messages = [];
39
- for (var _i = 1; _i < arguments.length; _i++) {
40
- messages[_i - 1] = arguments[_i];
41
- }
42
- if (config.debug) {
43
- log.apply(void 0, messages);
44
- }
45
- }
46
- function warn() {
47
- var messages = [];
48
- for (var _i = 0; _i < arguments.length; _i++) {
49
- messages[_i] = arguments[_i];
50
- }
51
- messages.forEach(function (message) {
52
- console.log(chalk.red(message));
53
- });
54
- }
55
- var flatten = function (arr) {
56
- return arr.reduce(function (a, b) {
57
- return b ? a.concat(b) : a;
58
- }, []);
59
- };
60
- function generateGruntConfig(moduleName, config) {
61
- if (config === void 0) { config = {}; }
62
- return function (grunt) {
63
- setupGrunt(grunt, moduleName, config);
64
- };
65
- }
66
- exports["default"] = generateGruntConfig;
67
- var generateScopedName = function (name, filename, css) {
68
- var path = require('path');
69
- var file = path.basename(filename, '.scss');
70
- var module = filename.match(/[\\\/]modules[\\\/]([\w\-_]+)/);
71
- var moduleName;
72
- if (module) {
73
- moduleName = module[1];
74
- }
75
- else {
76
- //if we cant find module name from path, we'll use a hash
77
- //https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript
78
- var hash = 0;
79
- if (filename.length == 0) {
80
- moduleName = '_unknown';
81
- }
82
- else {
83
- for (var i = 0; i < filename.length; i++) {
84
- var char = filename.charCodeAt(i);
85
- hash = (hash << 5) - hash + char;
86
- hash = hash & hash; // Convert to 32bit integer
87
- }
88
- moduleName = hash;
89
- }
90
- }
91
- // console.log("Module name: "+moduleName);
92
- // console.log("Returning: " + moduleName + "_" + file + "_" + name);
93
- return moduleName + '_' + file + '_' + name;
94
- };
95
- function setupGrunt(grunt, moduleName, config) {
96
- var buildServer = !config.environment || config.environment == 'server';
97
- var buildFrontend = !config.environment || config.environment == 'frontend';
98
- //when not specified and we ARe building frontend OR we are compiling the server for es5.. or if simply specified, then es5 is targeted
99
- var targetES5 = (!config.target && (buildFrontend || config.es5Server)) ||
100
- config.target == 'es5';
101
- var targetES6 = !config.target || config.target == 'es6';
102
- var targets = [];
103
- if (targetES5)
104
- targets.push('es5');
105
- if (targetES6)
106
- targets.push('es6');
107
- var targetLog = 'building ' + targets.join(', ');
108
- if (buildServer && !buildFrontend) {
109
- log(targetLog + ' lib only');
110
- }
111
- else if (!buildServer && buildFrontend) {
112
- log(targetLog + ' dist bundles only');
113
- }
114
- else if (buildServer && buildFrontend) {
115
- if (config.es5Server) {
116
- log(targetLog + ' lib files & dist bundles');
117
- }
118
- else {
119
- log(targetLog + ' dist bundles and es6 lib files');
120
- }
121
- }
122
- else {
123
- log('invalid configuration combination');
124
- }
125
- require('load-grunt-tasks')(grunt);
126
- //defaults
127
- grunt.registerTask('default', ['prepare-build', 'concurrent:dev']);
128
- grunt.registerTask('dev', targetES6 ? ['prepare-build', 'dev-es6'] : ['prepare-build', 'dev-es5']);
129
- grunt.registerTask('build', targets.map(function (target) { return 'build-' + target; }));
130
- if (buildFrontend) {
131
- grunt.registerTask('build-frontend', __spreadArray([
132
- 'prepare-build'
133
- ], targets.map(function (target) { return 'webpack:build-' + target; })));
134
- }
135
- grunt.registerTask('build-production', flatten([
136
- 'clean:lib',
137
- 'prepare-build',
138
- buildFrontend ? targets.map(function (target) { return 'webpack:prod-' + target; }) : null,
139
- buildServer ? ['exec:build-lib'] : null,
140
- ]));
141
- var prepareBuild = ['postcss:cssjson'];
142
- if (config.beforeBuildCommand) {
143
- prepareBuild.push('exec:beforeBuildCommand');
144
- }
145
- //specific tasks
146
- grunt.registerTask('prepare-build', prepareBuild);
147
- grunt.registerTask('dev-es6-production', [
148
- 'prepare-build',
149
- 'concurrent:dev-prod',
150
- ]);
151
- grunt.registerTask('dev-es6', ['prepare-build', 'concurrent:dev']);
152
- grunt.registerTask('dev-es5', ['prepare-build', 'concurrent:dev-es5']);
153
- //build-es5 is by default just the frontend because the server is es6
154
- //however some specific modules (like @dacore/module) require the typescript compiler ('build-lib') to run for es5
155
- //so that core-es5 or browser-core-es5 can internalise its files
156
- //this can by triggered with es5Server
157
- grunt.registerTask('build-es5', flatten([
158
- 'postcss',
159
- buildFrontend ? 'webpack:build-es5' : null,
160
- config.es5Server ? 'exec:build-lib-es5' : null,
161
- ]));
162
- grunt.registerTask('build-es6', flatten([
163
- 'prepare-build',
164
- buildFrontend ? 'webpack:build-es6' : null,
165
- buildServer ? ['exec:build-lib'] : null,
166
- 'exec:shapes',
167
- ]));
168
- grunt.registerTask('build-lib', ['prepare-build', 'exec:build-lib']);
169
- grunt.registerTask('build-production-es5', [
170
- 'prepare-build',
171
- 'webpack:prod-es5',
172
- 'exec:shapes',
173
- ]);
174
- grunt.registerTask('build-production-es6', [
175
- 'prepare-build',
176
- 'webpack:prod-es6',
177
- 'exec:shapes',
178
- ]);
179
- // log('setting grunt config');
180
- grunt.initConfig({
181
- exec: {
182
- 'build-lib': 'tsc --pretty',
183
- 'build-lib-es5': 'tsc --pretty -p tsconfig-es5.json',
184
- beforeBuildCommand: config.beforeBuildCommand,
185
- 'server-dev': 'tsc -w',
186
- test: 'tsc -w',
187
- shapes: 'lincd shapes',
188
- 'css-declarations': 'tcm -p **/*.scss',
189
- 'postcss-modules': 'yarn postcss --use postcss-import postcss-cssnext postcss-nested postcss-modules -o build/draft.css -i scss/*'
190
- },
191
- postcss: {
192
- options: {
193
- map: true,
194
- processors: [require('postcss-modules')({ generateScopedName: generateScopedName })],
195
- syntax: require('postcss-scss'),
196
- writeDest: false
197
- },
198
- cssjson: {
199
- src: 'src/**/*.scss'
200
- }
201
- },
202
- clean: {
203
- lib: ['lib/']
204
- },
205
- concurrent: {
206
- dev: flatten([
207
- buildFrontend ? 'webpack:dev' : null,
208
- buildServer ? 'exec:server-dev' : null,
209
- // buildServer ? 'watch:css-module-transforms' : null,
210
- // 'exec:css-declarations-watch'
211
- ]),
212
- 'dev-prod': flatten([
213
- buildFrontend ? 'webpack:dev-prod' : null,
214
- buildServer ? 'exec:server-dev' : null,
215
- // buildServer ? 'watch:css-module-transforms' : null,
216
- // 'exec:css-declarations-watch'
217
- ]),
218
- 'dev-es5': flatten([
219
- buildFrontend ? 'webpack:dev-es5' : null,
220
- buildServer ? 'exec:server-dev' : null,
221
- // buildServer ? 'watch:css-module-transforms' : null,
222
- // 'exec:css-declarations-watch'
223
- ]),
224
- options: {
225
- logConcurrentOutput: true,
226
- logTaskName: 3,
227
- logBlacklist: []
228
- }
229
- },
230
- webpack: {
231
- options: {
232
- stats: {
233
- chunks: false,
234
- version: false,
235
- warningsFilter: function (warning) {
236
- return warning.indexOf('There are multiple modules') !== -1;
237
- }
238
- }
239
- },
240
- dev: generateWebpackConfig('dev', moduleName, Object.assign({
241
- target: 'es6',
242
- watch: true
243
- }, config, config.es6, config.dev)),
244
- 'dev-prod': generateWebpackConfig('dev', moduleName, Object.assign({
245
- target: 'es6',
246
- watch: true,
247
- productionMode: true
248
- }, config, config.es6, config.prod)),
249
- 'dev-es5': generateWebpackConfig('dev-es5', moduleName, Object.assign({
250
- target: 'es5',
251
- watch: true
252
- }, config, config.es5, config.dev)),
253
- 'build-es6': generateWebpackConfig('build-es6', moduleName, Object.assign({
254
- target: 'es6',
255
- watch: false
256
- }, config, config.es6, config.dev)),
257
- 'build-es5': generateWebpackConfig('build-es5', moduleName, Object.assign({
258
- target: 'es5',
259
- watch: false
260
- }, config, config.es5, config.dev)),
261
- 'prod-es5': generateWebpackConfig('prod-es5', moduleName, Object.assign({
262
- target: 'es5',
263
- watch: false,
264
- productionMode: true
265
- }, config, config.es5, config.prod)),
266
- 'prod-es6': generateWebpackConfig('prod-es6', moduleName, Object.assign({
267
- target: 'es6',
268
- watch: false,
269
- productionMode: true
270
- }, config, config.es6, config.prod))
271
- }
272
- });
273
- grunt.config.init.exec = {
274
- test: 'echo "yey"'
275
- };
276
- //load the npm grunt task modules
277
- [
278
- 'grunt-webpack',
279
- 'grunt-exec',
280
- 'grunt-concurrent',
281
- 'grunt-contrib-clean',
282
- '@lodder/grunt-postcss',
283
- ].forEach(function (taskName) {
284
- debug(config, 'loading grunt task ' + taskName);
285
- var localPath = path.resolve(__dirname, 'node_modules', taskName, 'tasks');
286
- var localPath2 = path.resolve(__dirname, '..', 'node_modules', taskName, 'tasks');
287
- var workspacePath = path.resolve(__dirname, '..', '..', 'node_modules', taskName, 'tasks');
288
- var nestedWorkspacePath = path.resolve(__dirname, '..', '..', '..', 'node_modules', taskName, 'tasks');
289
- if (fs.existsSync(localPath)) {
290
- // grunt.loadNpmTasks(taskName);
291
- debug('Loading from ' + localPath);
292
- grunt.task.loadTasks(localPath);
293
- }
294
- else if (fs.existsSync(localPath2)) {
295
- // grunt.loadNpmTasks(taskName);
296
- debug('Loading from ' + localPath2);
297
- grunt.task.loadTasks(localPath2);
298
- }
299
- else if (fs.existsSync(workspacePath)) {
300
- //windows, so it seems
301
- debug('Loading from ' + workspacePath);
302
- grunt.task.loadTasks(workspacePath);
303
- }
304
- else if (fs.existsSync(nestedWorkspacePath)) {
305
- //mac / linux
306
- debug('Loading from ' + nestedWorkspacePath);
307
- grunt.task.loadTasks(nestedWorkspacePath);
308
- }
309
- else {
310
- warn("Could not load grunt task module " + taskName + "\nCould not find task at any of these paths:\n" + localPath + "\n" + localPath2 + "\n" + workspacePath + "\n" + nestedWorkspacePath);
311
- }
312
- });
313
- }
314
- exports.setupGrunt = setupGrunt;
315
- function generateWebpackConfig(buildName, moduleName, config) {
316
- if (config === void 0) { config = {}; }
317
- if (!config.externals)
318
- config.externals = {};
319
- if (!config.internals)
320
- config.internals = [];
321
- var watch = config.watch;
322
- var productionMode = nodeProduction || config.productionMode;
323
- var es5 = config.target == 'es5';
324
- var es6 = config.target == 'es6';
325
- var configFile;
326
- if (es5 && fs.existsSync('tsconfig-es5.json')) {
327
- configFile = 'tsconfig-es5.json';
328
- }
329
- else {
330
- configFile = 'tsconfig.json';
331
- }
332
- if (!fs.existsSync(configFile)) {
333
- warn('Cannot find ' + configFile);
334
- process.exit();
335
- }
336
- var pack = utils_1.getPackageJSON();
337
- var plugins = [
338
- new webpack.DefinePlugin({
339
- 'process.env.BROWSER': JSON.stringify(true),
340
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
341
- }),
342
- new webpack.NoEmitOnErrorsPlugin(),
343
- new ExtractTextPlugin(config.cssFileName
344
- ? config.cssFileName
345
- : libraryName + '.' + moduleName + '.css'),
346
- new MiniCssExtractPlugin({
347
- // linkType: false,
348
- filename: config.cssFileName
349
- ? config.cssFileName
350
- : libraryName + '.' + moduleName + '.css'
351
- }),
352
- new WebpackLicencePlugin(
353
- //output sometimes includes things like webpack, which seems not needed? this doesn't work though
354
- // {
355
- // excludedPackageTest:((packageName, packageVersion) => {
356
- // return pack.devDependencies && packageName in pack.devDependencies;
357
- // })
358
- // }
359
- ),
360
- ];
361
- if (config.debug) {
362
- plugins.push(new watch_run_1["default"]());
363
- }
364
- if (config.afterBuildCommand) {
365
- plugins.push({
366
- apply: function (compiler) {
367
- compiler.hooks.afterEmit.tap('AfterEmitPlugin', function (compilation) {
368
- exec(config.afterBuildCommand, function (err, stdout, stderr) {
369
- if (stdout)
370
- process.stdout.write(stdout);
371
- if (stderr)
372
- process.stderr.write(stderr);
373
- });
374
- });
375
- }
376
- });
377
- }
378
- if (config.analyse) {
379
- plugins.push(new BundleAnalyzerPlugin());
380
- }
381
- if (es6 || config.declarations === true) {
382
- plugins.push(new declaration_plugin_1["default"]({
383
- out: (config.filename ? config.filename : libraryName + '.' + moduleName) +
384
- '.d.ts',
385
- root: config.outputPath ? config.outputPath : './lib/',
386
- debug: 'debug' in config ? config.debug : false
387
- }));
388
- }
389
- var resolvePlugins = [
390
- new TsconfigPathsPlugin({
391
- configFile: configFile,
392
- silent: true
393
- }),
394
- ];
395
- var aliases = config.alias || {};
396
- var rules = [
397
- {
398
- test: /\.(scss|css)$/,
399
- use: [
400
- MiniCssExtractPlugin.loader,
401
- {
402
- loader: 'css-loader',
403
- options: {
404
- url: false
405
- }
406
- },
407
- {
408
- loader: 'postcss-loader',
409
- options: {
410
- postcssOptions: {
411
- plugins: {
412
- 'postcss-import': {},
413
- 'postcss-cssnext': {},
414
- 'postcss-nested': {},
415
- // "postcss-scss": {}, //<-- only add this back if the build gets stuck on //comments in scss files, but I dont think that will be the case anymore
416
- 'postcss-modules': {
417
- //by default postcss-modules will put out a json file right next to the original css / scss file, this method defines what classnames to use
418
- generateScopedName: generateScopedName,
419
- globalModulePaths: [/tailwind/]
420
- },
421
- tailwindcss: {
422
- purge: {
423
- enabled: productionMode,
424
- content: [
425
- './src/**/*.tsx',
426
- './src/**/*.ts',
427
- //also include @dacore modules which are internalized with the "internal" config option
428
- //imports like ... from '@dacore/module/lib/views/SomeView' will
429
- //these modules should live in the node_modules folder of the root of the site
430
- //TODO: remake this with multiple lincd modules
431
- // '../../node_modules/@dacore/*/lib/**/*.js',
432
- // './node_modules/@dacore/*/lib/**/*.js',
433
- ]
434
- }
435
- }
436
- }
437
- }
438
- }
439
- },
440
- {
441
- loader: 'sass-loader',
442
- options: { sourceMap: true }
443
- },
444
- ]
445
- },
446
- {
447
- test: /\.tsx?$/,
448
- use: [
449
- {
450
- loader: 'ts-loader?' +
451
- JSON.stringify({
452
- configFile: configFile,
453
- compilerOptions: {
454
- declaration: !es5
455
- }
456
- })
457
- },
458
- ]
459
- },
460
- {
461
- enforce: 'pre',
462
- test: /\.js$/,
463
- use: [
464
- {
465
- loader: 'source-map-loader'
466
- },
467
- ]
468
- },
469
- ];
470
- if (es5 && config.internalsources && config.internalsources.length > 0) {
471
- //usually a module that transpiles to es5 will only have es5 code in the bundle.
472
- //however a module that INTERNALISES other dacore modules will directly include es6 code from @dacore/other_modules/lib
473
- //which eventually results in an import of @dacore/core being bundled as 'const =', which trips up old browsers
474
- //so we fix that here by just referring directly to the typescript source instead of the transpiled js for internalised modules
475
- //however this means that for internalised modules THE SOURCE CODE NEEDS TO BE AVAILABLE. This is currently NOT the case with how we publish modules to yarn
476
- //so that means internalised modules need to be LOCALLY AVAILABLE with yarn workspaces
477
- plugins.push(new webpack.NormalModuleReplacementPlugin(/\lincd\/lib\//, function (resource, match) {
478
- var moduleName = resource.request.match(/lincd\/lib\//)[1];
479
- if (config.internalsources.indexOf(moduleName) !== -1) {
480
- console.log(colors.magenta('internal sources + ES5: Replacing /lib/ with /src/ for source-internalised module ' +
481
- moduleName));
482
- resource.request = resource.request.replace('/lib/', '/src/');
483
- console.log(colors.magenta('internal sources + ES5: ' + resource.request));
484
- console.log(colors.red("WARNING: Make sure you have the TYPESCRIPT SOURCE FILES of the modules listed as 'internal' AVAILABLE ON YOUR LOCAL MACHINE. So if you check in node_modules/your-internalised-module - that should be a symbolic link and you will find a 'src' folder with typescript files there."));
485
- }
486
- }));
487
- }
488
- return {
489
- entry: config.entry ? config.entry : './src/index.ts',
490
- output: {
491
- filename: (config.filename ? config.filename : libraryName + '.' + moduleName) +
492
- (es5 ? '.es5' : '') +
493
- '.js',
494
- path: path.resolve(process.cwd(), config.bundlePath || 'dist'),
495
- devtoolModuleFilenameTemplate: moduleName + '/[resource-path]'
496
- },
497
- devtool: productionMode ? 'cheap-source-map' : 'cheap-source-map',
498
- mode: productionMode ? 'production' : 'development',
499
- //fixing a persistent but strange build error here that showed up once, this is a workaround. See: https://github.com/webpack-contrib/css-loader/issues/447
500
- node: {
501
- fs: 'empty',
502
- child_process: 'empty'
503
- },
504
- resolve: {
505
- extensions: ['.webpack.js', '.js', '.ts', '.tsx', '.json'],
506
- alias: aliases,
507
- plugins: resolvePlugins
508
- },
509
- resolveLoader: {
510
- modules: [
511
- path.join(__dirname, 'plugins'),
512
- path.join(__dirname, 'node_modules'),
513
- 'node_modules',
514
- ]
515
- },
516
- optimization: {
517
- minimize: productionMode,
518
- minimizer: [new TerserPlugin({
519
- extractComments: {
520
- condition: /^\**!|@preserve|@license|@cc_on/i,
521
- banner: function (licenseFile) {
522
- return "License information can be found in " + licenseFile + " and oss-licences.json";
523
- }
524
- }
525
- })]
526
- },
527
- watch: watch,
528
- module: {
529
- rules: rules
530
- },
531
- //See plugins/externalise-modules.ts We're passing in a function here that determines what to exclude from the bundle and what not
532
- //See also https://webpack.js.org/configuration/externals/
533
- externals: externalise_modules_1["default"](config, es5),
534
- plugins: plugins,
535
- stats: {
536
- errorDetails: config.debug,
537
- chunks: false,
538
- children: false,
539
- version: true,
540
- hash: false,
541
- modules: false
542
- }
543
- };
544
- }
545
- exports.generateWebpackConfig = generateWebpackConfig;
package/utils.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.getPackageJSON = void 0;
4
- var fs = require("fs");
5
- var path = require("path");
6
- var getPackageJSON = function (root) {
7
- if (root === void 0) { root = process.cwd(); }
8
- var packagePath = path.join(root, 'package.json');
9
- if (fs.existsSync(packagePath)) {
10
- return JSON.parse(fs.readFileSync(packagePath, 'utf8'));
11
- }
12
- else if (root === process.cwd()) {
13
- console.warn('Could not find package.json. Make sure you run this command from the root of a lincd module or a lincd yarn workspace');
14
- process.exit();
15
- }
16
- };
17
- exports.getPackageJSON = getPackageJSON;