我使用的WebPack加載依賴一個錯誤。和依賴性的一個是這樣寫如下:的WebPack報告有關意外的字符「#」
#! /usr/bin/env node
'use strict'
var Parser = require('jsonparse')
, through = require('through')
的WebPack給了我下面的錯誤:
ERROR in ./~/JSONStream/index.js
Module parse failed: /Project/node_modules/JSONStream/index.js Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #! /usr/bin/env node
看來,性格#
不被認可的WebPack。有沒有一個加載器可以用來加載這種js文件?
確保節點的二進制在你的環境中的路徑和刪除行'#!/usr/bin/env節點「並查看它是否有效。 –
刪除該行工作正常,但它是第三方庫我無法更改其源代碼。 –
您可以使用[家當裝載機(https://github.com/javascriptismagic/shebang-loader)。 –