Browse Source

add svelte-native-preprocessor and remove xmlns

halfnelson 6 years ago
parent
commit
96f1e699e7
4 changed files with 19 additions and 4 deletions
  1. 1 1
      app/App.svelte
  2. 6 0
      package-lock.json
  3. 2 1
      package.json
  4. 10 2
      webpack.config.js

+ 1 - 1
app/App.svelte

@@ -1,4 +1,4 @@
-<page xmlns="tns" class="page">
+<page class="page">
     <actionBar title="My App" icon="" class="action-bar">
     </actionBar>
     <stackLayout class="p-20">

+ 6 - 0
package-lock.json

@@ -5056,6 +5056,12 @@
             "resolved": "https://registry.npmjs.org/svelte-native/-/svelte-native-0.1.3.tgz",
             "integrity": "sha512-Qf880raC++bcbItsUs/EnCAhQ7lMcdPraeB6PngNnOan2R+IdoowCNQ9RkyvR9ISAaKnN0J6iFoD5driQn8TCg=="
         },
+        "svelte-native-preprocessor": {
+            "version": "0.1.1",
+            "resolved": "https://registry.npmjs.org/svelte-native-preprocessor/-/svelte-native-preprocessor-0.1.1.tgz",
+            "integrity": "sha512-7nI8CfcP5uQnaDoNzh67/EzTYaYmY6DEz//W2rFrJfKGpBEL8dKicCU5B3pkV5Qb/acly6dtZMucCLvz1SuzDQ==",
+            "dev": true
+        },
         "tapable": {
             "version": "1.0.0",
             "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz",

+ 2 - 1
package.json

@@ -21,7 +21,8 @@
         "nativescript-dev-typescript": "~0.8.0",
         "nativescript-dev-webpack": "~0.20.0",
         "svelte": "^3.0.0-beta.8",
-        "svelte-loader": "halfnelson/svelte-loader#fix-virtual-purge"
+        "svelte-loader": "halfnelson/svelte-loader#fix-virtual-purge",
+        "svelte-native-preprocessor": "0.1.1"
     },
     "gitHead": "59b6da006346fedb5bb201fcc9cd7d204a69a82f",
     "readme": "NativeScript Application"

+ 10 - 2
webpack.config.js

@@ -8,6 +8,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
 const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
 const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
 const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
+const svelteNativePreprocessor = require("svelte-native-preprocessor");
 
 module.exports = env => {
     // Add your custom Activities, Services and other Android app components here.
@@ -198,8 +199,15 @@ module.exports = env => {
                 {
                     test: /\.svelte$/,
                     exclude: /node_modules/,
-                    use: 'svelte-loader'
-                },
+                    use: [
+                        { 
+                            loader: 'svelte-loader',
+                            options: {
+                                preprocess: svelteNativePreprocessor()
+                            }
+                        }
+                    ]
+                }
             ]
         },
         plugins: [