Giter Club home page Giter Club logo

Comments (1)

tanrich avatar tanrich commented on June 24, 2024

目录结构

project\ (根目录)
            js\ ( js 目录 )
               lib\ ( 库目录 )
                    esl.js 
                    require.js
               main.js ( data-main 对应的 ) 
               app1.js ( app1.html 用的 )
            css\ 
            app1.html
app1.html 部分代码

注意: 如果这里使用 requirejs 则不会报错
使用 esl.js 会报 project/tweenmax.js net::ERR_FILE_NOT_FOUND

<script src="./js/lib/esl.js" data-main="js/main"></script>
<script>
    // 使用 requirejs 这里换成 require(['app1']);
    require(['js/app1']);
</script>
main.js 部分代码

require.config({
    baseUrl:'js',
    paths: {
        'tweenmax': './lib/tweenmax.min',

    },
    shim: {
        'tweenmax': {
            exports: 'TweenMax'
        }
    }
});
app1.js 部分代码
define(function (require) {
    var TweenMax = require("tweenmax")
    // var GSDevTools = require("GSDevTools")

})

如果描述不够请给我留言,使用 esl.js 有一段时间了,体积比 require.js 要小,不太想放弃,还请帮忙排查下,感觉应该是自己水平不够对路径转换理解比较浅造成的原因

我在项目中没有遇到你这个问题。看报错就是路径的问题,都定位到 project 根目录下了。

from esl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.