I just developed the project using webpack2 and vue2. I have other external plugins which cannot be installed through npm. So my question is the best way to include these files. Here are my index.html
<html>
<head>
</head>
<body>
<div id="app"></div>
<script src="app.js"></script>
<script src="/static/js/flowchart.js"></script>
<script src="/static/js/exteral2.js"></script>
</body>
</html>
this is my index.html whare I include some external js files. Can we do some bundling so that we dont need to include these external files to index.html or this is the only way to include external js files.
Any help would be highly appreciated. Thanks
I just developed the project using webpack2 and vue2. I have other external plugins which cannot be installed through npm. So my question is the best way to include these files. Here are my index.html
<html>
<head>
</head>
<body>
<div id="app"></div>
<script src="app.js"></script>
<script src="/static/js/flowchart.js"></script>
<script src="/static/js/exteral2.js"></script>
</body>
</html>
this is my index.html whare I include some external js files. Can we do some bundling so that we dont need to include these external files to index.html or this is the only way to include external js files.
Any help would be highly appreciated. Thanks
Share Improve this question asked Jan 5, 2018 at 12:26 Amit SharmaAmit Sharma 2,4873 gold badges21 silver badges26 bronze badges 1- Possible duplicate of How to include external file with webpack – Liam Commented Jan 5, 2018 at 12:41
2 Answers
Reset to default 1Include external file in code with relative path:
import './static/js/flowchart.js';
Usually you can do this by just importing the external js files into your *.vue
file like this:
import './external/js/.js';
But in Webpacka you need to not parse these files as modules:
https://github./webpack/webpack.js/issues/63
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745391472a4625679.html
评论列表(0条)