@startupjs/bundler 0.55.0-alpha.1 → 0.55.0-alpha.12

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.
package/README.md CHANGED
@@ -81,6 +81,6 @@ export default function ShoppingCart () {
81
81
  }
82
82
  ```
83
83
 
84
- ## MIT Licence
84
+ ## MIT License
85
85
 
86
86
  Copyright (c) 2018 Pavel Zhukov
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs/bundler",
3
- "version": "0.55.0-alpha.1",
3
+ "version": "0.55.0-alpha.12",
4
4
  "description": "Opinionated scripts and configs to develop a react-native-web project",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -20,13 +20,13 @@
20
20
  "@mdx-js/mdx": "^2.3.0",
21
21
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
22
22
  "@startupjs/babel-plugin-react-css-modules": "^6.5.4-1",
23
- "@startupjs/css-to-react-native-transform": "^1.9.0-1",
24
- "@startupjs/plugin": "^0.55.0-alpha.1",
23
+ "@startupjs/css-to-react-native-transform": "^1.9.0-2",
24
+ "@startupjs/plugin": "^0.55.0-alpha.12",
25
25
  "@svgr/webpack": "~7.0.0",
26
26
  "assets-webpack-plugin": "^7.1.1",
27
27
  "autoprefixer": "^10.4.0",
28
28
  "babel-loader": "^8.2.3",
29
- "babel-preset-startupjs": "^0.55.0-alpha.1",
29
+ "babel-preset-startupjs": "^0.55.0-alpha.12",
30
30
  "css-loader": "^6.5.0",
31
31
  "css-minimizer-webpack-plugin": "^5.0.0",
32
32
  "file-loader": "^6.2.0",
@@ -50,5 +50,5 @@
50
50
  "peerDependencies": {
51
51
  "react-native-svg": "*"
52
52
  },
53
- "gitHead": "f9f14627172890e54490aa3717e21f19614a958b"
53
+ "gitHead": "d9fdf45341ca733978cdc4fa2562055922e0c2ed"
54
54
  }
@@ -1,83 +0,0 @@
1
- const { getPluginConfigs } = require('@startupjs/plugin/manager.cjs')
2
- const pickBy = require('lodash/pickBy')
3
- const path = require('path')
4
- const nodeExternals = require('webpack-node-externals')
5
- const PROD = !process.env.WEBPACK_DEV
6
- const BUILD_DIR = '/build/'
7
- const BUILD_PATH = path.join(process.cwd(), BUILD_DIR)
8
- const PLUGINS = getPluginConfigs()
9
-
10
- const EXTENSIONS = ['.server.js', '.server.jsx', '.server.ts', '.server.tsx', '.server.cjs', '.server.mjs', '.js', '.jsx', '.mjs', '.cjs', '.ts', '.tsx', '.json']
11
-
12
- const DEFAULT_ALIAS = {
13
- }
14
-
15
- module.exports = function getConfig (env, {
16
- forceCompileModules = [],
17
- modulesDir = 'node_modules',
18
- alias = {}
19
- } = {}) {
20
- process.env.BABEL_ENV = 'server'
21
-
22
- if (typeof forceCompileModules === 'string') {
23
- forceCompileModules = JSON.parse(forceCompileModules)
24
- }
25
- if (typeof alias === 'string') {
26
- alias = JSON.parse(alias)
27
- }
28
- forceCompileModules = forceCompileModules
29
- .concat(getPluginsForceCompileList())
30
-
31
- forceCompileModules = forceCompileModules.map(moduleName => {
32
- return new RegExp('^' + moduleName + '($|/)')
33
- })
34
- return pickBy({
35
- externalsPresets: { node: true }, // in order to ignore built-in modules like path, fs, etc.
36
- externals: [nodeExternals({ // in order to ignore all modules in node_modules folder
37
- modulesDir,
38
- allowlist: forceCompileModules
39
- })], // in order to ignore all modules in node_modules folder
40
- mode: PROD ? 'production' : 'development',
41
- devtool: 'source-map',
42
- entry: {
43
- server: ['@babel/polyfill', './server.js']
44
- },
45
- plugins: [
46
- // TODO: Reenable progress plugin if the following issue gets fixed:
47
- // https://github.com/open-cli-tools/concurrently/issues/85
48
- // new webpack.ProgressPlugin()
49
- ],
50
- output: {
51
- path: BUILD_PATH,
52
- filename: PROD ? '[name].cjs' : '[name].dev.cjs'
53
- },
54
- module: {
55
- rules: [
56
- {
57
- test: /\.[cm]?[jt]sx?$/,
58
- resolve: {
59
- fullySpecified: false
60
- },
61
- loader: 'babel-loader'
62
- }
63
- ]
64
- },
65
- resolve: {
66
- extensions: EXTENSIONS,
67
- alias: {
68
- ...DEFAULT_ALIAS,
69
- ...alias
70
- }
71
- }
72
- }, Boolean)
73
- }
74
-
75
- function getPluginsForceCompileList () {
76
- let list = []
77
- for (const plugin in PLUGINS) {
78
- const value = PLUGINS[plugin]?.bundler?.forceCompile?.server
79
- if (value === true) list.push(plugin)
80
- if (Array.isArray(value)) list = list.concat(value)
81
- }
82
- return list
83
- }