Yuki Takei 9 лет назад
Родитель
Сommit
76166de01e
4 измененных файлов с 9 добавлено и 4 удалено
  1. 5 0
      config/webpack.common.js
  2. 1 3
      config/webpack.dev.js
  3. 3 0
      lib/views/layout/layout.html
  4. 0 1
      package.json

+ 5 - 0
config/webpack.common.js

@@ -29,6 +29,11 @@ module.exports = function (options) {
       'plugin':               './resource/js/plugin',
       'plugin':               './resource/js/plugin',
       'style':                './resource/styles',
       'style':                './resource/styles',
     },
     },
+    externals: {
+      // require("jquery") is external and available
+      //  on the global var jQuery
+      "jquery": "jQuery"
+    },
     resolve: {
     resolve: {
       extensions: ['.js', '.json'],
       extensions: ['.js', '.json'],
       modules: [helpers.root('src'), helpers.root('node_modules')],
       modules: [helpers.root('src'), helpers.root('node_modules')],

+ 1 - 3
config/webpack.dev.js

@@ -56,9 +56,7 @@ module.exports = function (options) {
         bundles: {
         bundles: {
           vendor: [
           vendor: [
             'react',
             'react',
-            'react-dom',
-            'jquery',
-            'jquery.cookie',
+            'react-dom'
           ],
           ],
         },
         },
         dllDir: helpers.root('public/js/dll'),
         dllDir: helpers.root('public/js/dll'),

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

@@ -22,6 +22,9 @@
   <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
   <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
   <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
   <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
 
 
+  <!-- jQuery -->
+  <script src="//cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
+
   {% if env === 'development' %}
   {% if env === 'development' %}
     <script src="/js/dll/vendor.dll.js"></script>
     <script src="/js/dll/vendor.dll.js"></script>
     <script src="{{ webpack_asset('dev').js }}" async></script>
     <script src="{{ webpack_asset('dev').js }}" async></script>

+ 0 - 1
package.json

@@ -79,7 +79,6 @@
     "i18next-node-fs-backend": "~0.1.3",
     "i18next-node-fs-backend": "~0.1.3",
     "i18next-sprintf-postprocessor": "~0.2.2",
     "i18next-sprintf-postprocessor": "~0.2.2",
     "inline-attachment": "git+https://github.com/Rovak/InlineAttachment.git#2.0.3",
     "inline-attachment": "git+https://github.com/Rovak/InlineAttachment.git#2.0.3",
-    "jquery": "~3.2.1",
     "jquery.cookie": "~1.4.1",
     "jquery.cookie": "~1.4.1",
     "marked": "~0.3.6",
     "marked": "~0.3.6",
     "method-override": "~2.3.1",
     "method-override": "~2.3.1",