@teambit/preview 1.0.884 → 1.0.885

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.
@@ -1,36 +0,0 @@
1
- /*!
2
- Copyright (c) 2018 Jed Watson.
3
- Licensed under the MIT License (MIT), see
4
- http://jedwatson.github.io/classnames
5
- */
6
-
7
- /*!
8
- * is-primitive <https://github.com/jonschlinkert/is-primitive>
9
- *
10
- * Copyright (c) 2014-present, Jon Schlinkert.
11
- * Released under the MIT License.
12
- */
13
-
14
- /*! *****************************************************************************
15
- Copyright (C) Microsoft. All rights reserved.
16
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
17
- this file except in compliance with the License. You may obtain a copy of the
18
- License at http://www.apache.org/licenses/LICENSE-2.0
19
-
20
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
22
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
23
- MERCHANTABLITY OR NON-INFRINGEMENT.
24
-
25
- See the Apache Version 2.0 License for specific language governing permissions
26
- and limitations under the License.
27
- ***************************************************************************** */
28
-
29
- /**
30
- * @license
31
- * Lodash <https://lodash.com/>
32
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
33
- * Released under MIT license <https://lodash.com/license>
34
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
35
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
36
- */
@@ -1,2 +0,0 @@
1
- import type { Configuration } from 'webpack';
2
- export declare function createWebpackConfig(outputDir: string, entryFile: string): Configuration;
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createWebpackConfig = createWebpackConfig;
7
- function _reactWebpack() {
8
- const data = require("@teambit/react.webpack.react-webpack");
9
- _reactWebpack = function () {
10
- return data;
11
- };
12
- return data;
13
- }
14
- function _webpack() {
15
- const data = require("webpack");
16
- _webpack = function () {
17
- return data;
18
- };
19
- return data;
20
- }
21
- function _webpackMerge() {
22
- const data = require("webpack-merge");
23
- _webpackMerge = function () {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function _webpack2() {
29
- const data = require("@teambit/webpack");
30
- _webpack2 = function () {
31
- return data;
32
- };
33
- return data;
34
- }
35
- function _webpackManifestPlugin() {
36
- const data = require("webpack-manifest-plugin");
37
- _webpackManifestPlugin = function () {
38
- return data;
39
- };
40
- return data;
41
- }
42
- function createWebpackConfig(outputDir, entryFile) {
43
- const baseConfig = (0, _reactWebpack().configBaseFactory)(true);
44
- const preBundleConfig = createPreBundleConfig(outputDir, entryFile);
45
- const combined = (0, _webpackMerge().merge)(baseConfig, preBundleConfig);
46
- return combined;
47
- }
48
- function createPreBundleConfig(outputDir, entryFile) {
49
- const mode = process.env.BIT_DEBUG_PREVIEW_BUNDLE ? 'development' : 'production';
50
- const preBundleConfig = {
51
- stats: {
52
- children: true,
53
- errorDetails: true
54
- },
55
- mode,
56
- entry: {
57
- main: entryFile
58
- },
59
- resolve: {
60
- alias: {
61
- 'react/jsx-runtime': require.resolve('react/jsx-runtime'),
62
- react: require.resolve('react'),
63
- 'react-dom': require.resolve('react-dom')
64
- },
65
- fallback: {
66
- module: false,
67
- path: _webpack2().fallbacks.path,
68
- dgram: false,
69
- dns: false,
70
- fs: false,
71
- stream: false,
72
- http2: false,
73
- net: false,
74
- tls: false,
75
- child_process: false,
76
- process: _webpack2().fallbacks.process
77
- }
78
- },
79
- output: {
80
- path: outputDir,
81
- publicPath: '/',
82
- chunkFilename: 'static/js/[name].[contenthash:8].chunk.cjs',
83
- filename: 'static/js/[name].[contenthash:8].cjs',
84
- library: {
85
- type: 'commonjs-static'
86
- }
87
- },
88
- externalsType: 'commonjs',
89
- externals: ['react', 'react-dom', '@mdx-js/react', '@teambit/mdx.ui.mdx-scope-context'],
90
- plugins: [
91
- // Generate an asset manifest file with the following content:
92
- // - "files" key: Mapping of all asset filenames to their corresponding
93
- // output file so that tools can pick it up without having to parse
94
- // `index.html`
95
- // can be used to reconstruct the HTML if necessary
96
- new (_webpackManifestPlugin().WebpackManifestPlugin)({
97
- fileName: 'asset-manifest.json',
98
- generate: (seed, files, entrypoints) => {
99
- const manifestFiles = files.reduce((manifest, file) => {
100
- manifest[file.name] = file.path;
101
- return manifest;
102
- }, seed);
103
- const entrypointFiles = entrypoints.main.filter(fileName => !fileName.endsWith('.map'));
104
-
105
- // @ts-ignore - https://github.com/shellscape/webpack-manifest-plugin/issues/276
106
- return {
107
- files: manifestFiles,
108
- entrypoints: entrypointFiles
109
- };
110
- }
111
- }), new (_webpack().ProvidePlugin)({
112
- process: _webpack2().fallbacksProvidePluginConfig.process
113
- })]
114
- };
115
- return preBundleConfig;
116
- }
117
-
118
- //# sourceMappingURL=webpack.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactWebpack","data","require","_webpack","_webpackMerge","_webpack2","_webpackManifestPlugin","createWebpackConfig","outputDir","entryFile","baseConfig","configBaseFactory","preBundleConfig","createPreBundleConfig","combined","merge","mode","process","env","BIT_DEBUG_PREVIEW_BUNDLE","stats","children","errorDetails","entry","main","resolve","alias","react","fallback","module","path","fallbacks","dgram","dns","fs","stream","http2","net","tls","child_process","output","publicPath","chunkFilename","filename","library","type","externalsType","externals","plugins","WebpackManifestPlugin","fileName","generate","seed","files","entrypoints","manifestFiles","reduce","manifest","file","name","entrypointFiles","filter","endsWith","ProvidePlugin","fallbacksProvidePluginConfig"],"sources":["webpack.config.ts"],"sourcesContent":["import { configBaseFactory } from '@teambit/react.webpack.react-webpack';\n\nimport type { Configuration } from 'webpack';\nimport { ProvidePlugin } from 'webpack';\nimport { merge } from 'webpack-merge';\nimport { fallbacksProvidePluginConfig, fallbacks } from '@teambit/webpack';\nimport { WebpackManifestPlugin } from 'webpack-manifest-plugin';\n\nexport function createWebpackConfig(outputDir: string, entryFile: string): Configuration {\n const baseConfig = configBaseFactory(true);\n const preBundleConfig = createPreBundleConfig(outputDir, entryFile);\n\n const combined = merge(baseConfig, preBundleConfig);\n\n return combined;\n}\n\nfunction createPreBundleConfig(outputDir: string, entryFile: string) {\n const mode = process.env.BIT_DEBUG_PREVIEW_BUNDLE ? 'development' : 'production';\n const preBundleConfig: Configuration = {\n stats: {\n children: true,\n errorDetails: true,\n },\n mode,\n entry: {\n main: entryFile,\n },\n resolve: {\n alias: {\n 'react/jsx-runtime': require.resolve('react/jsx-runtime'),\n react: require.resolve('react'),\n 'react-dom': require.resolve('react-dom'),\n },\n fallback: {\n module: false,\n path: fallbacks.path,\n dgram: false,\n dns: false,\n fs: false,\n stream: false,\n http2: false,\n net: false,\n tls: false,\n child_process: false,\n process: fallbacks.process,\n },\n },\n output: {\n path: outputDir,\n publicPath: '/',\n chunkFilename: 'static/js/[name].[contenthash:8].chunk.cjs',\n filename: 'static/js/[name].[contenthash:8].cjs',\n library: {\n type: 'commonjs-static',\n },\n },\n externalsType: 'commonjs',\n externals: ['react', 'react-dom', '@mdx-js/react', '@teambit/mdx.ui.mdx-scope-context'],\n plugins: [\n // Generate an asset manifest file with the following content:\n // - \"files\" key: Mapping of all asset filenames to their corresponding\n // output file so that tools can pick it up without having to parse\n // `index.html`\n // can be used to reconstruct the HTML if necessary\n new WebpackManifestPlugin({\n fileName: 'asset-manifest.json',\n generate: (seed, files, entrypoints) => {\n const manifestFiles = files.reduce((manifest, file) => {\n manifest[file.name] = file.path;\n return manifest;\n }, seed);\n const entrypointFiles = entrypoints.main.filter((fileName) => !fileName.endsWith('.map'));\n\n // @ts-ignore - https://github.com/shellscape/webpack-manifest-plugin/issues/276\n return {\n files: manifestFiles,\n entrypoints: entrypointFiles,\n } as Record<string, string>;\n },\n }),\n\n new ProvidePlugin({ process: fallbacksProvidePluginConfig.process }),\n ],\n };\n\n return preBundleConfig;\n}\n"],"mappings":";;;;;;AAA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CAAC9B,IAAI,CAACqC,MAAM,CAAEX,QAAQ,IAAK,CAACA,QAAQ,CAACY,QAAQ,CAAC,MAAM,CAAC,CAAC;;QAEzF;QACA,OAAO;UACLT,KAAK,EAAEE,aAAa;UACpBD,WAAW,EAAEM;QACf,CAAC;MACH;IACF,CAAC,CAAC,EAEF,KAAIG,wBAAa,EAAC;MAAE9C,OAAO,EAAE+C,wCAA4B,CAAC/C;IAAQ,CAAC,CAAC;EAExE,CAAC;EAED,OAAOL,eAAe;AACxB","ignoreList":[]}
@@ -1,88 +0,0 @@
1
- import { configBaseFactory } from '@teambit/react.webpack.react-webpack';
2
-
3
- import type { Configuration } from 'webpack';
4
- import { ProvidePlugin } from 'webpack';
5
- import { merge } from 'webpack-merge';
6
- import { fallbacksProvidePluginConfig, fallbacks } from '@teambit/webpack';
7
- import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
8
-
9
- export function createWebpackConfig(outputDir: string, entryFile: string): Configuration {
10
- const baseConfig = configBaseFactory(true);
11
- const preBundleConfig = createPreBundleConfig(outputDir, entryFile);
12
-
13
- const combined = merge(baseConfig, preBundleConfig);
14
-
15
- return combined;
16
- }
17
-
18
- function createPreBundleConfig(outputDir: string, entryFile: string) {
19
- const mode = process.env.BIT_DEBUG_PREVIEW_BUNDLE ? 'development' : 'production';
20
- const preBundleConfig: Configuration = {
21
- stats: {
22
- children: true,
23
- errorDetails: true,
24
- },
25
- mode,
26
- entry: {
27
- main: entryFile,
28
- },
29
- resolve: {
30
- alias: {
31
- 'react/jsx-runtime': require.resolve('react/jsx-runtime'),
32
- react: require.resolve('react'),
33
- 'react-dom': require.resolve('react-dom'),
34
- },
35
- fallback: {
36
- module: false,
37
- path: fallbacks.path,
38
- dgram: false,
39
- dns: false,
40
- fs: false,
41
- stream: false,
42
- http2: false,
43
- net: false,
44
- tls: false,
45
- child_process: false,
46
- process: fallbacks.process,
47
- },
48
- },
49
- output: {
50
- path: outputDir,
51
- publicPath: '/',
52
- chunkFilename: 'static/js/[name].[contenthash:8].chunk.cjs',
53
- filename: 'static/js/[name].[contenthash:8].cjs',
54
- library: {
55
- type: 'commonjs-static',
56
- },
57
- },
58
- externalsType: 'commonjs',
59
- externals: ['react', 'react-dom', '@mdx-js/react', '@teambit/mdx.ui.mdx-scope-context'],
60
- plugins: [
61
- // Generate an asset manifest file with the following content:
62
- // - "files" key: Mapping of all asset filenames to their corresponding
63
- // output file so that tools can pick it up without having to parse
64
- // `index.html`
65
- // can be used to reconstruct the HTML if necessary
66
- new WebpackManifestPlugin({
67
- fileName: 'asset-manifest.json',
68
- generate: (seed, files, entrypoints) => {
69
- const manifestFiles = files.reduce((manifest, file) => {
70
- manifest[file.name] = file.path;
71
- return manifest;
72
- }, seed);
73
- const entrypointFiles = entrypoints.main.filter((fileName) => !fileName.endsWith('.map'));
74
-
75
- // @ts-ignore - https://github.com/shellscape/webpack-manifest-plugin/issues/276
76
- return {
77
- files: manifestFiles,
78
- entrypoints: entrypointFiles,
79
- } as Record<string, string>;
80
- },
81
- }),
82
-
83
- new ProvidePlugin({ process: fallbacksProvidePluginConfig.process }),
84
- ],
85
- };
86
-
87
- return preBundleConfig;
88
- }