question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add some additional docs for webpack 2 usage.

See original GitHub issue

Hello, you may add the following note for webpack 2 usage. Please add my github name as a contributor to the package if you decide to include this in your docs.


Note that ‘with’ that is deprecated in es6. For webpack 2 usage, you must pass an option in your query strict=true or _with=false that will disable with in the ejs package.

Examples: strict=true

import tmpl1 from '!!../?strict=true!./template.ejs';
import tmpl2 from '!!../?delimiter=?&strict=true!./template2.ejs';
import tmpl3 from '!!../?strict=true!./subdir/parent.ejs';

_with=false

import tmpl1 from '!!../?_with=false!./template.ejs';
import tmpl2 from '!!../?delimiter=?&_with=false!./template2.ejs';
import tmpl3 from '!!../?_with=false!./subdir/parent.ejs';

Template examples:

You will need to refer to your vars from the locals object when with has been disabled as illustrated below:

Hello, <%=locals.noun%>!
<? for(var key in locals.hobbies) { var hobby = locals.hobbies[key]; -?>
  I like {{=hobby}}.
<? } ?>
child: <%= locals.foo %>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bazilio91commented, Apr 9, 2020

kinda rotten, reopen if needed.

0reactions
neginbasiricommented, Nov 19, 2017

@AndreiSoroka Do you know how to get webpack watch changes for include files?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration - webpack
dev is an online tool for creating custom webpack configurations. It allows you to select various features that will be combined and added...
Read more >
Entry Points - webpack
We will show you the ways you can configure the entry property, in addition to explaining why it may be useful to you....
Read more >
webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Getting Started - webpack
Custom parameters can be passed to webpack by adding two dashes between the npm run build command and your parameters, e.g. npm run...
Read more >
Loaders - webpack
Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found