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只能处理前端能调用的文件