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

window is not defined #41

Closed
lughino opened this issue Jun 9, 2016 · 2 comments
Closed

window is not defined #41

lughino opened this issue Jun 9, 2016 · 2 comments

Comments

@lughino
Copy link

lughino commented Jun 9, 2016

This loader does not work on os x!
always returns ERROR in ReferenceError: window is not defined.
This is my setup:

loaders: [
      {
        test: /\.(png|jpg|jpeg|gif)$/,
        loader: 'file'
      },
      {
        test: /\.html$/,
        loader: 'ngtemplate!html'
      },
      { test: /\.json$/, loader: 'json-loader' }
    ]
@lughino
Copy link
Author

lughino commented Jun 11, 2016

Well, the problem is that it is necessary to exclude the index.template.html file that is passed to the plugin html-webpack-plugin, in this way:

loaders: [
      {
        test: /\.(png|jpg|jpeg|gif)$/,
        loader: 'file'
      },
      {
        test: /\.html$/,
        exclude: [
          path.resolve(__dirname, 'public/index.template.html')
        ],
        loader: 'ngtemplate!html'
      },
      { test: /\.json$/, loader: 'json-loader' }
    ]

@WearyMonkey It would be useful to put this in the documentation!

@lughino lughino closed this as completed Jun 11, 2016
@mribichich
Copy link

Same happend to me, I didn't see it in the docs. It fixed it!

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