Minify and Obfuscate Router Component


#1

Hi, I have a problem
I want a minify and obfuscate (or only minify) a file Router Component (example: calendar.html) that has inside and tags. I try make this with jscrambler but it show me error: SyntaxError: ‘return’ outside of function. I Try something like this :

(function(){
         return {
              data: .....,
              methods: ......,
              on: ...
         }
})();

This Jscramble accepts but framework 7 show error…

Uncaught (in promise) TypeError: Cannot read property 'template' of undefined
    at parseComponent (framework7.js:10616)
    at Object.parse (framework7.js:10656)
    at framework7.js:8532

Any idea how I can fix this?

Pd. Sorry my bad English. :expressionless:


#2

do you use webpack?


#3

No, I not use webpack, I’m working with framework7 core 3.4.2 and cordova.


#4

It is not possible to minify single file router component content. Only if you include it under main file and refactor it to JavaScript Object like:

{
  path: '/some-component/',
  component: {
    template: `<div class="page">...</div>`,
    data() {},
    methods: {},
    ...
  },