简体   繁体   English

如何在Webpack中复制/包括外部文件

[英]How to copy/include external file in webpack

My project depends on react and mxGraph, and i am using webpack as bundle tool. 我的项目依赖于react和mxGraph,我正在使用webpack作为捆绑工具。 Currently i am building react using webpack and manually including <script type="text/javascript" src="js/mxGraph/mxClient.js"></script> in index.html file. 目前,我正在使用webpack构建反应,并手动在index.html文件中包括<script type="text/javascript" src="js/mxGraph/mxClient.js"></script> Now i want to concat/add mxClient.js file content to bundle.js file generated by webpack. 现在,我想将mxClient.js文件内容concat /添加到webpack生成的bundle.js文件中。

index.js index.js

var React = require('react'),
    ReactDOM = require('react-dom');

window.React = React;
window.ReactDOM = ReactDOM;

this generates bundle.js file with react deps to this i want to add/append mxClient.js content to bundle.js via webpack 这将生成具有对此的反应部门的bundle.js文件,我想通过webpack将mxClient.js内容添加/附加到bundle.js中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM