You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaced the string-based bundle config with webpack's config writer.
This fixes the issue where restarts of the python process cause the bundle to be rebuilt.
Additionally, it also makes it easier to hook into the low-level parts of the component bundling process and makes changes as needed.
Re markfinger#32
Copy file name to clipboardExpand all lines: react/templates.py
-40Lines changed: 0 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -1,43 +1,3 @@
1
-
BUNDLE_CONFIG= \
2
-
"""
3
-
module.exports = {{
4
-
context: '{dir}',
5
-
entry: '{file}',
6
-
output: {{
7
-
path: '[bundle_dir]/react-components',
8
-
filename: '{var}-[hash].js',
9
-
libraryTarget: 'umd',
10
-
library: '{var}'
11
-
}},
12
-
externals: [{{
13
-
react: {{
14
-
commonjs2: '{path_to_react}',
15
-
root: 'React'
16
-
}},
17
-
'react/addons': {{
18
-
commonjs2: '{path_to_react}',
19
-
root: 'React'
20
-
}}
21
-
}}]{devtool_config}{translate_config}
22
-
}};
23
-
"""
24
-
25
-
DEVTOOL_CONFIG=""",\n devtool: '{devtool}'"""
26
-
27
-
BUNDLE_TRANSLATE_CONFIG= \
28
-
""",
29
-
module: {{
30
-
loaders: [{{
31
-
test: /\{ext}$/,
32
-
exclude: /node_modules/,
33
-
loader: 'babel-loader'
34
-
}}]
35
-
}},
36
-
resolveLoader: {{
37
-
root: '{node_modules}'
38
-
}}
39
-
"""
40
-
41
1
MOUNT_JS= \
42
2
"""
43
3
if (typeof React === 'undefined') throw new Error('Cannot find `React` global variable. Have you added a script element to this page which points to React?');
0 commit comments