Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin works for too long #1

Closed
snowindy opened this issue Jun 7, 2015 · 9 comments
Closed

Plugin works for too long #1

snowindy opened this issue Jun 7, 2015 · 9 comments

Comments

@snowindy
Copy link
Contributor

snowindy commented Jun 7, 2015

Hey,
I tried to place all files (~1000 html files) that previously were in assets folder to app folder.
This was done to make html and corresponding js files close to each other - so I don't have dig into assets folder every time I work on js file.

I tried to switch off the minifier with config, it did not help.

brunch watch: before this change it took ~ 4s to complete initial watch iteration
brunch watch: after this change it took more than 5 minutes, I stopped waiting and cancelled

I used this config:

plugins:
    htmlPages:
      removeComments: false
      removeCommentsFromCDATA: false
      removeCDATASectionsFromCDATA: false
      collapseBooleanAttributes: false
      useShortDoctype: false
      removeEmptyAttributes: false
      removeScriptTypeAttributes: false
      removeStyleLinkTypeAttributes: false
      collapseWhitespace: false
      minifyJS: false
      minifyCSS: false
      destination : (path) -> path.replace /^app[\/\\](.*)\.html$/, "$1.html"

@tolyo
Copy link
Owner

tolyo commented Jun 7, 2015

Hey
The best use case for the plugin is a large Angular app with a module-based structure akin to ngBoilerplate, so based on your description above - you're using it exactly as intended.

Can you confirm that you're experiencing this with the default config?
If so can you confirm that you're experiencing this with 10 files? 100 files?

@tolyo
Copy link
Owner

tolyo commented Jun 8, 2015

You're missing htmlMin config. Try this:

    htmlPages: {
      htmlMin: {
        removeComments: false,
        removeCommentsFromCDATA: false,
        removeCDATASectionsFromCDATA: false,
        collapseBooleanAttributes: false,
        useShortDoctype: false,
        removeEmptyAttributes: false,
        removeScriptTypeAttributes: false,
        removeStyleLinkTypeAttributes: false,
        collapseWhitespace: false,
        minifyJS: false,
        minifyCSS: false
      },
      destination: function(path) {
        return path.replace(/^app[\/\\](.*)\.html$/, "$1.html");
      }
    }

@snowindy
Copy link
Contributor Author

snowindy commented Jun 8, 2015

In fact, this file was the root cause of slowness.
When your plugin used html-minifier 0.7.2 on this file it hanged forever.
Apparently it's a bug of minifier, I am creating an issue for them.

<div class="widget-title pm-modal-header"><span class="icon"> <i class="icon-align-justify"></i></span>
    <h5 ng-i18next="app.logged-in.template.raw-template-code"></h5>
</div>

<div class="modal-body pm-modal-full-screen-body pm-boxed-content" style="padding: 40px 0px 60px 0px;>
    <div class="pm-boxed-content-relative">     
        <div class="spinner-large-white" ng-show="loadingTemplate == true"></div>   
        <textarea id="templateCode" pm-code-editor mode="template.mode" content="template.content" width="100%" height="100%"></textarea>
    </div>
</div>
<div class="modal-footer pm-wizard-form-actions">
    <button class="btn btn-primary" ng-click="ok()"><i class="icon-ok icon-white pm-button-icon"></i>OK</button>
</div>

@tolyo
Copy link
Owner

tolyo commented Jun 8, 2015

Its hicking up here:

<div class="modal-body pm-modal-full-screen-body pm-boxed-content" style="padding: 40px 0px 60px 0px;>

Style attribute is not closed.

@tolyo tolyo closed this as completed Jun 8, 2015
@snowindy
Copy link
Contributor Author

snowindy commented Jun 8, 2015

Off topic:
Could you also tell me how to install this plugin globally?
I tried 'npm install -g html-pages-brunch' and this leads to this:

c:\workspace\propzmedia-all\mcloud-studio\mcloud-studio-web\src\main\webapp\brunch>npm install -g html-pages-brunch
[email protected] C:\Users\eg\AppData\Roaming\npm\node_modules\html-pages-brunch
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]

c:\workspace\propzmedia-all\mcloud-studio\mcloud-studio-web\src\main\webapp\brunch>brunch watch
c:\Users\eg\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:446
          throw new Error("You probably need to execute `npm install` to insta
                ^
Error: You probably need to execute `npm install` to install brunch plugins. Error: Cannot find module ....

@tolyo
Copy link
Owner

tolyo commented Jun 8, 2015

sudo npm install -g html-pages-brunch

@tolyo tolyo reopened this Jun 8, 2015
@snowindy
Copy link
Contributor Author

snowindy commented Jun 8, 2015

This is exactly what I did:

c:\workspace\propzmedia-all\mcloud-studio\mcloud-studio-web\src\main\webapp\brunch>npm install -g html-pages-brunch

I use windows, no sudo here.

@tolyo
Copy link
Owner

tolyo commented Jun 8, 2015

Right. Well its not downloading those dependencies so I am not sure what the Windows solution for that would be. Sorry can't help.

@tolyo tolyo closed this as completed Jun 8, 2015
@snowindy
Copy link
Contributor Author

snowindy commented Jun 8, 2015

no problem, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants