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

opts key for query not working #54

Closed
bonesoul opened this issue Jun 1, 2017 · 2 comments
Closed

opts key for query not working #54

bonesoul opened this issue Jun 1, 2017 · 2 comments
Assignees

Comments

@bonesoul
Copy link

bonesoul commented Jun 1, 2017

for webpack2 i have the following config;

      {
        // nunjucks template loader.
        test: /\.html$/, use: [{
          loader: 'nunjucks-loader',
          query: {
            opts: {
              autoescape: true, // escape dangerous characters.
              trimBlocks: true, // automatically remove trailing newlines from a block/tag
              lstripBlocks: true, // automatically remove leading whitespace from a block/tag
              web: {
                useCache: true // will enable cache and templates will never see updates.
              }
            },
            config: __dirname + '/assets/js/common/nunjucks.config.js'
          },
        }]
      },

my nunjucks.config.js;

const moment = require('moment/min/moment-with-locales.min.js');

module.exports = function (env) {
  // add moment to client side nunjucks too.
  env.addGlobal('moment', moment); // eslint-disable-line no-undef

  console.dir(env);
}

and i see on browser that these settings are not applied to env;

opts:
autoescape:true
dev:false
lstripBlocks:false
throwOnUndefined:false
trimBlocks:false

any ideas?

@at0g at0g self-assigned this Jun 1, 2017
@calledT
Copy link

calledT commented Jun 15, 2017

Relative to Introduce getOptions

@bonesoul
Copy link
Author

so how can i fix that?

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

3 participants