Npm 如何使用openlayer';s';导入&x27;使用parcel在多个文件中运行函数?

Npm 如何使用openlayer';s';导入&x27;使用parcel在多个文件中运行函数?,npm,bundle,package.json,parceljs,openlayers-6,Npm,Bundle,Package.json,Parceljs,Openlayers 6,我已经使用OL6.4.3生成了地图。我已使用npm和包裹包安装了ol。我的package.json是 "name": "gis", "version": "1.0.0", "description": "", "main": "map.js", "scripts": { "test

我已经使用OL6.4.3生成了地图。我已使用npm和包裹包安装了ol。我的package.json是

  "name": "gis",
  "version": "1.0.0",
  "description": "",
  "main": "map.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "parcel map.js",
    "build": "parcel build --public-url . map*.js"
  },
  "author": "User123",
  "license": "ISC",
  "dependencies": {
    "ol": "^6.4.3",
    "ol-layerswitcher": "^3.6.0",
    "ol-popup": "^4.0.0",
    "proj4": "^2.6.2"
  },
  "devDependencies": {
    "parcel-bundler": "^1.12.4"
  }
}
我可以在map.js文件中使用openlayer的所有“import”功能。现在我想在另一个文件tools.js中使用导入。但这是一个错误,我无法导入。我应该如何配置我的package.json,以便导入其他或多个js文件