andrey-skl / ng-annotate-loader

Webpack loader to annotate angular applications
MIT License
120 stars 28 forks source link

Error: #4

Closed kentcdodds closed 9 years ago

kentcdodds commented 9 years ago

I'm getting this error when upgrading from 0.0.2 to 0.0.3.

ERROR in ./index.js
Module build failed: ReferenceError: filename is not defined
    at Object.module.exports (/Users/kentcdodds/Developer/formly-js/angular-formly/node_modules/ng-annotate-loader/loader.js:47:31)

Any idea what it might be? I only get this when doing my minified build. Here's my config (JSON.stringified, so some functions/complex objects may be missing):

{
  "context": "/Users/kentcdodds/Developer/formly-js/angular-formly/src",
  "entry": "./index.js",
  "output": {
    "filename": "dist/formly.min.js",
    "libraryTarget": "umd",
    "library": "ngFormly"
  },
  "stats": {
    "colors": true,
    "reasons": true
  },
  "externals": {
    "chai": "chai",
    "sinon-chai": "sinonChai",
    "sinon": "sinon",
    "lodash": "_",
    "angular": "angular",
    "api-check": {
      "root": "apiCheck",
      "amd": "api-check",
      "commonjs2": "api-check",
      "commonjs": "api-check"
    }
  },
  "plugins": [
    {
      "definitions": {
        "process.env.NODE_ENV": "\"production\"",
        "VERSION": "\"6.14.0\""
      }
    },
    {
      "options": {
        "raw": true
      },
      "banner": "//! angular-formly version 6.14.0 built with ♥ by Astrism <astrisms@gmail.com>, Kent C. Dodds <kent@doddsfamily.us> (ó ì_í)=óò=(ì_í ò)\n"
    },
    {},
    {},
    {
      "options": {}
    },
    {
      "options": {
        "compress": {
          "warnings": false
        }
      }
    }
  ],
  "resolve": {
    "extensions": [
      "",
      ".js"
    ],
    "alias": {
      "angular-fix": "/Users/kentcdodds/Developer/formly-js/angular-formly/src/angular-fix"
    }
  },
  "module": {
    "loaders": [
      {
        "test": {},
        "loaders": [
          "raw"
        ],
        "exclude": {}
      },
      {
        "test": {},
        "loaders": [
          "ng-annotate",
          "babel",
          "eslint"
        ],
        "exclude": {}
      }
    ]
  },
  "eslint": {
    "emitError": true,
    "failOnError": true,
    "failOnWarning": false,
    "quiet": true
  },
  "devtool": "source-map"
}

Again, this works fine with 0.0.2

kentcdodds commented 9 years ago

Verified. Upgrading to 0.0.4 fixes the issue :+1: thanks for the quick response!

andrey-skl commented 9 years ago

@kentcdodds Thanks) Feel free to open more issues)