H5W3
当前位置:H5W3 > 其他技术问题 > 正文

DllPlugin预编译出错

ERROR in ./main/libs/dll/libiconv.so
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ dll myselflib

webpack.dll.js文件如下

const  webpack = require("webpack");
const path = require("path");

module.exports = {
    output: {
        path: path.join(__dirname, "../"),
        filename: '[name].js',
        library: '[name]'
       
    },
    entry: {
        myselflib: [
            path.join(__dirname, "../main/libs/dll/linkus_sdk.dylib"),
            path.join(__dirname, "../main/libs/dll/libcrypto.so"),
            path.join(__dirname, "../main/libs/dll/libiconv.so"),
            path.join(__dirname, "../main/libs/dll/libssl.so"),
            path.join(__dirname, "../main/libs/dll/libxml2.so"),
        ]
      },
      
    plugins: [
        new webpack.DllPlugin({
            path: path.join(__dirname, "../manifest.json"),
            name: '[name]',
            context: __dirname
          })
    ],     

};

运行 ./node_modules/.bin/webpack --config ./config/webpack.dll.js
然后一直报错,找不到原因

回答:

webpack处理不了so文件,你这个是什么鬼,这里的dll不是linux系统里的dll。webpack只能处理前端能调用的文件

本文地址:H5W3 » DllPlugin预编译出错

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址