Closed thisismygatekeeper closed 2 years ago
Similiar to #19, live2dcubismcore.min.js
is not a module, nor does it mount anything on global scope (usually window
), that's why it's supposed to be loaded by <script>
.
Not familiar with chrome extension, but I guess there's a way to load this script separately, so that it'll work as if it's loaded by <script>
.
If that doesn't work, another way is to modify the script by replacing the first statement:
var Live2DCubismCore;
with:
window.Live2DCubismCore = {};
then the variable will be correctly exposed, and the script can be imported as usual:
import 'live2dcubismcore.min.js';
OMFG it worked!!!! @guansss LOVE YOU MY BRO!!
I'm trying to use this library in chrome extension. The content script doesn't have html context (thus no
<script>
tag). We have successfully importedlive2d.min.js
and it worked for the cubism v2. But we couldn't importlive2dcubismcore.min.js
. Have tried to usebut got an error
Failed to start up Cubism 4 framework.
. Strangely, there's also no retry logs being printed.Any thoughts how we can properly include this library? Thanks!