首页 / 浏览问题 / 云GIS / 问题详情
iclient9.0.1用webpack开发报错
49EXP 2018年03月12日

使用产品:iclient classic 9.0.1

我现在想使用classic9.0.1+webpack+vue进行开发,npm官网上https://www.npmjs.com/package/@supermap/iclient-classic有下面的引用但是我找不到SuperMap-8.1.1,引入SuperMap.include.js或者SuperMap-8.1.1-14426.js会报错。请问SuperMap-8.1.1在哪下载呢?

1个回答

你好,下载地址如下:

http://support.supermap.com.cn/DownloadCenter/DownloadPage.aspx?id=666

所依赖的样式也在其中,resource和theme文件夹中

另附上

package.json

{
  "name": "iclient9dclassic",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@supermap/iclient-classic": "^9.0.1",
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.4",
    "babel-plugin-istanbul": "^4.1.5",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-es2015": "^6.24.1",
    "extract-text-webpack-plugin": "^3.0.2",
    "file-loader": "^1.1.11",
    "url-loader": "^1.0.1",
    "webpack-cli": "^2.0.11",
    "webpack-node-externals": "^1.6.0"
  },
  "devDependencies": {
    "webpack": "^4.1.1",
    "webpack-dev-server": "^3.1.1"
  }
}

webpack.config.js

var packageName = "iClient9DClassic";
var path = require('path');
module.exports = {
    //页面入口文件配置
    entry: './src/MapVServiceTest.js',
    //入口文件输出配置
    output: {
        path: __dirname + '/dist',
        filename: packageName + ".js"
    },

    //其它解决方案配置
    resolve: {
        extensions: ['.js', '.json', '.css']
    },

    module: {
        rules: [{
            //图片小于80k采用base64编码
            test: /\.(png|jpg|jpeg|gif|woff|woff2|svg|eot|ttf)$/,
            use: [{
                loader: 'url-loader',
                options: {
                    limit: 80000
                }
            }]
        }, {
            test: /\.js$/,
            include: [
                path.resolve(__dirname, "node_modules/@supermap/iclient-common"),
                path.resolve(__dirname, "node_modules/@supermap/iclient-classic"),
                path.resolve(__dirname, "node_modules/elasticsearch"),
            ],
            loader: 'babel-loader',
            options: {
                presets: ['es2015']
            }
        }]
    }
};

246EXP 2018年03月12日
...