@startupjs/bundler 0.40.1 → 0.41.0
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/lib/mdxExamplesLoader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const REGEX = /(```jsx +example[\s\S]*?\n)([\s\S]*?)(```)/g
|
|
2
|
-
const PURE_REGEX = /(```jsx
|
|
2
|
+
const PURE_REGEX = /(```jsx +pure-example[\s\S]*?\n)([\s\S]*?)(```)/g
|
|
3
3
|
|
|
4
4
|
const EXAMPLE_FLAGS = [
|
|
5
5
|
'noscroll'
|
|
@@ -44,11 +44,21 @@ function replacer (match, p1, p2, p3) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function pureReplacer (match, p1, p2, p3) {
|
|
47
|
+
const parts = p1.trim().split(' ')
|
|
48
|
+
const sectionParts = []
|
|
49
|
+
|
|
50
|
+
for (const part of parts) {
|
|
51
|
+
if (EXAMPLE_FLAGS.includes(part)) {
|
|
52
|
+
sectionParts.push(part)
|
|
53
|
+
continue
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
p2 = p2.trim().replace(/\n+/g, '\n')
|
|
48
58
|
if (/^</.test(p2)) p2 = 'return (<React.Fragment>' + p2 + '</React.Fragment>)'
|
|
49
59
|
|
|
50
60
|
return (
|
|
51
|
-
`<section>
|
|
61
|
+
`<section ${sectionParts.join(' ')}>
|
|
52
62
|
<React.Fragment>
|
|
53
63
|
{React.createElement(__observer(function Example () {
|
|
54
64
|
${p2}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs/bundler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Opinionated scripts and configs to develop a react-native-web project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@mdx-js/mdx": "^1.6.22",
|
|
21
21
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
|
|
22
22
|
"@startupjs/css-to-react-native-transform": "^1.9.0-1",
|
|
23
|
-
"@startupjs/plugin": "^0.
|
|
23
|
+
"@startupjs/plugin": "^0.41.0",
|
|
24
24
|
"@svgr/webpack": "~5.5.0",
|
|
25
25
|
"assets-webpack-plugin": "^7.1.1",
|
|
26
26
|
"autoprefixer": "^10.4.0",
|
|
27
27
|
"babel-loader": "^8.2.3",
|
|
28
|
-
"babel-preset-startupjs": "^0.
|
|
28
|
+
"babel-preset-startupjs": "^0.41.0",
|
|
29
29
|
"css-loader": "^6.5.0",
|
|
30
30
|
"css-minimizer-webpack-plugin": "^3.1.1",
|
|
31
31
|
"file-loader": "^6.2.0",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"postcss-loader": "^6.2.0",
|
|
40
40
|
"process": "^0.11.10",
|
|
41
41
|
"react-native-svg-transformer": "0.14.3",
|
|
42
|
+
"react-refresh": "^0.10.0",
|
|
42
43
|
"style-loader": "^3.3.1",
|
|
43
44
|
"stylus": "0.54.7",
|
|
44
45
|
"stylus-loader": "^6.2.0",
|
|
@@ -48,5 +49,5 @@
|
|
|
48
49
|
"peerDependencies": {
|
|
49
50
|
"react-native-svg": ">= 12.1.0"
|
|
50
51
|
},
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "3f2d1582418ddbb989fd48de6dbc2c6847f36f26"
|
|
52
53
|
}
|
package/webpack.server.config.js
CHANGED
|
@@ -2,7 +2,6 @@ const { getPluginConfigs } = require('@startupjs/plugin/manager.cjs')
|
|
|
2
2
|
const pickBy = require('lodash/pickBy')
|
|
3
3
|
const path = require('path')
|
|
4
4
|
const nodeExternals = require('webpack-node-externals')
|
|
5
|
-
const webpack = require('webpack')
|
|
6
5
|
const PROD = !process.env.WEBPACK_DEV
|
|
7
6
|
const BUILD_DIR = '/build/'
|
|
8
7
|
const BUILD_PATH = path.join(process.cwd(), BUILD_DIR)
|
|
@@ -44,7 +43,9 @@ module.exports = function getConfig (env, {
|
|
|
44
43
|
server: ['@babel/polyfill', './server.js']
|
|
45
44
|
},
|
|
46
45
|
plugins: [
|
|
47
|
-
|
|
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()
|
|
48
49
|
],
|
|
49
50
|
output: {
|
|
50
51
|
path: BUILD_PATH,
|
package/webpack.web.config.js
CHANGED
|
@@ -155,7 +155,9 @@ module.exports = function getConfig (env, {
|
|
|
155
155
|
}
|
|
156
156
|
}, Boolean),
|
|
157
157
|
plugins: [
|
|
158
|
-
|
|
158
|
+
// TODO: Reenable progress plugin if the following issue gets fixed:
|
|
159
|
+
// https://github.com/open-cli-tools/concurrently/issues/85
|
|
160
|
+
// new webpack.ProgressPlugin(),
|
|
159
161
|
new MomentLocalesPlugin(), // strip all locales except 'en'
|
|
160
162
|
!PROD && new ReactRefreshWebpackPlugin({ forceEnable: true, overlay: { sockPort: DEV_PORT } }),
|
|
161
163
|
PROD && new MiniCssExtractPlugin({
|
|
@@ -172,7 +174,7 @@ module.exports = function getConfig (env, {
|
|
|
172
174
|
global: 'window'
|
|
173
175
|
}),
|
|
174
176
|
new webpack.ProvidePlugin({
|
|
175
|
-
process: 'process/browser'
|
|
177
|
+
process: 'process/browser.js'
|
|
176
178
|
})
|
|
177
179
|
].filter(Boolean),
|
|
178
180
|
output: {
|
|
@@ -325,7 +327,7 @@ module.exports = function getConfig (env, {
|
|
|
325
327
|
alias: {
|
|
326
328
|
...DEFAULT_ALIAS,
|
|
327
329
|
...alias,
|
|
328
|
-
process: 'process/browser'
|
|
330
|
+
process: 'process/browser.js'
|
|
329
331
|
},
|
|
330
332
|
extensions: EXTENSIONS,
|
|
331
333
|
mainFields: ['jsnext:main', 'browser', 'main']
|