Procházet zdrojové kódy

BugFix: devide legacy-form

Yuki Takei před 9 roky
rodič
revize
2660e4cc17
3 změnil soubory, kde provedl 11 přidání a 3 odebrání
  1. 3 2
      config/webpack.common.js
  2. 5 0
      lib/views/_form.html
  3. 3 1
      lib/views/layout/layout.html

+ 3 - 2
config/webpack.common.js

@@ -22,7 +22,8 @@ module.exports = function (options) {
   return {
   return {
     entry: {
     entry: {
       'app':                  './resource/js/app',
       'app':                  './resource/js/app',
-      'legacy':               ['./resource/js/legacy/crowi', './resource/js/legacy/crowi-form'],
+      'legacy':               './resource/js/legacy/crowi',
+      'legacy-form':          './resource/js/legacy/crowi-form',
       'legacy-admin':         './resource/js/legacy/crowi-admin',
       'legacy-admin':         './resource/js/legacy/crowi-admin',
       'legacy-presentation':  './resource/js/legacy/crowi-presentation',
       'legacy-presentation':  './resource/js/legacy/crowi-presentation',
       'plugin':               './resource/js/plugin',
       'plugin':               './resource/js/plugin',
@@ -84,7 +85,7 @@ module.exports = function (options) {
 
 
       new CommonsChunkPlugin({
       new CommonsChunkPlugin({
         name: 'commons',
         name: 'commons',
-        chunks: ['app', 'legacy', 'legacy-admin'],
+        chunks: ['app', 'legacy', 'legacy-form', 'legacy-admin'],
         minChunks: module => /node_modules/.test(module.resource),
         minChunks: module => /node_modules/.test(module.resource),
       }),
       }),
       new CommonsChunkPlugin({
       new CommonsChunkPlugin({

+ 5 - 0
lib/views/_form.html

@@ -1,3 +1,8 @@
+{% block html_head_loading_legacy %}
+  <script src="{{ webpack_asset('legacy-form').js }}" defer></script>
+  {% parent %}
+{% endblock %}
+
 {% if req.form.errors %}
 {% if req.form.errors %}
 <div class="alert alert-danger">
 <div class="alert alert-danger">
   <ul>
   <ul>

+ 3 - 1
lib/views/layout/layout.html

@@ -35,7 +35,9 @@
   {% if isEnabledPlugins() %}
   {% if isEnabledPlugins() %}
     <script src="{{ webpack_asset('plugin').js }}" defer></script>
     <script src="{{ webpack_asset('plugin').js }}" defer></script>
   {% endif %}
   {% endif %}
-  <script src="{{ webpack_asset('legacy').js }}" defer></script>
+  {% block html_head_loading_legacy %}
+    <script src="{{ webpack_asset('legacy').js }}" defer></script>
+  {% endblock %}
   <script src="{{ webpack_asset('app').js }}" defer></script>
   <script src="{{ webpack_asset('app').js }}" defer></script>
 
 
   <!-- Google Fonts -->
   <!-- Google Fonts -->