@startupjs/bundler 0.50.23 → 0.52.0-alpha.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 +7 -2
- package/lib/mdxLoader.js +0 -1
- package/package.json +8 -7
- package/webpack.web.config.js +6 -1
package/lib/mdxExamplesLoader.js
CHANGED
|
@@ -5,11 +5,16 @@ const EXAMPLE_FLAGS = [
|
|
|
5
5
|
'noscroll'
|
|
6
6
|
]
|
|
7
7
|
|
|
8
|
+
const DEFAULT_MDX_RENDERER = `
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import { observer as __observer } from 'startupjs'
|
|
11
|
+
`
|
|
12
|
+
|
|
8
13
|
module.exports = function mdxExamplesLoader (source) {
|
|
9
|
-
const observer = "import { observer as __observer } from 'startupjs'"
|
|
10
14
|
// NOTE: Two line breaks prevent crashing docs without imports
|
|
11
15
|
// when the text starts from the first line
|
|
12
|
-
return
|
|
16
|
+
return DEFAULT_MDX_RENDERER +
|
|
17
|
+
'\n' + source.replace(REGEX, replacer).replace(PURE_REGEX, pureReplacer)
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
function replacer (match, p1, p2, p3) {
|
package/lib/mdxLoader.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs/bundler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0-alpha.0",
|
|
4
4
|
"description": "Opinionated scripts and configs to develop a react-native-web project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/polyfill": "^7.8.0",
|
|
19
|
-
"@mdx-js/loader": "^
|
|
20
|
-
"@mdx-js/mdx": "^
|
|
19
|
+
"@mdx-js/loader": "^2.3.0",
|
|
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
23
|
"@startupjs/css-to-react-native-transform": "^1.9.0-1",
|
|
24
|
-
"@startupjs/plugin": "^0.
|
|
24
|
+
"@startupjs/plugin": "^0.51.0",
|
|
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.
|
|
29
|
+
"babel-preset-startupjs": "^0.52.0-alpha.0",
|
|
30
30
|
"css-loader": "^6.5.0",
|
|
31
|
-
"css-minimizer-webpack-plugin": "^
|
|
31
|
+
"css-minimizer-webpack-plugin": "^5.0.0",
|
|
32
32
|
"file-loader": "^6.2.0",
|
|
33
33
|
"lodash": "^4.17.20",
|
|
34
34
|
"metro-config": "*",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"process": "^0.11.10",
|
|
41
41
|
"react-native-svg-transformer": "0.20.0",
|
|
42
42
|
"react-refresh": "^0.10.0",
|
|
43
|
+
"remark-gfm": "^1.0.0",
|
|
43
44
|
"style-loader": "^3.3.1",
|
|
44
45
|
"stylus": "0.54.7",
|
|
45
46
|
"stylus-loader": "^6.2.0",
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"react-native-svg": ">= 12.1.0"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "69d52996bc2100f85ae17d8bc09b013f837f1fef"
|
|
53
54
|
}
|
package/webpack.web.config.js
CHANGED
|
@@ -18,6 +18,7 @@ const BUILD_PATH = path.join(process.cwd(), BUILD_DIR)
|
|
|
18
18
|
const BUNDLE_NAME = 'main'
|
|
19
19
|
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
|
|
20
20
|
const webpack = require('webpack')
|
|
21
|
+
const remarkGfm = require('remark-gfm')
|
|
21
22
|
const DEFAULT_MODE = 'react-native'
|
|
22
23
|
const PLUGINS = getPluginConfigs()
|
|
23
24
|
|
|
@@ -228,7 +229,11 @@ module.exports = function getConfig (env, {
|
|
|
228
229
|
use: [
|
|
229
230
|
{ loader: 'babel-loader' },
|
|
230
231
|
{
|
|
231
|
-
loader: '@mdx-js/loader'
|
|
232
|
+
loader: '@mdx-js/loader',
|
|
233
|
+
options: {
|
|
234
|
+
providerImportSource: '@startupjs/mdx/client/MDXProvider/index.js',
|
|
235
|
+
remarkPlugins: [remarkGfm]
|
|
236
|
+
}
|
|
232
237
|
},
|
|
233
238
|
{
|
|
234
239
|
loader: require.resolve('./lib/mdxExamplesLoader.js')
|