Comments (4)
For reference, here is a basic rollup config for ECMAScript project:
import globby from 'globby';
import del from 'rollup-plugin-delete';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
const input = {};
for (const file of globby.sync('**/*.{jsx,tsx}', {cwd: './sources'})) {
input[file.replace(/\.(jsx|tsx)$/, '')] = `sources/${file}`;
}
export default {
input,
output: {
dir: '../js.build',
entryFileNames: '[name].jsx',
chunkFileNames: '.chunks/[name]-[hash].js',
format: 'es',
sourcemap: true,
sourcemapExcludeSources: true,
},
plugins: [
del({targets: '../js.build', force: true, runOnce: true}),
resolve(),
commonjs(),
typescript(),
],
};
For a structure like this to work:
js/
node_modules/
sources/ - folder with sources
.gdignore
package.json
rollup.config.js
tsconfig.json
js.build/ - folder with build files which are used by godot
It needs addition of following packages:
@rollup/plugin-commonjs
@rollup/plugin-node-resolve
@rollup/plugin-typescript
globby
rollup
rollup-plugin-delete
tslib
And in package.json, initial scripts are replaced with those:
"watch": "rollup --config --watch",
"compile": "rollup --config"
from ecmascript.
Feel free to using webpack
The node module is mostly for development usage.
from ecmascript.
I mean that maybe a basic setup/config for some bundler (webpack, rollup or other) can be included with Generate TypeScript Project
.
Those issues with resolution, ignoring, exporting do apply to every project, they are not project specific.
Or do you think that this is out of scope?
from ecmascript.
I think we only need to ensure the functions of the core language binding. As for the use and selection of third-party libraries and tool chains, it should be left to its users. Of course, we can specify the design intent of which features in the document.
For node modules, its design intent is to quickly test third-party libraries, rather than directly releasing them into products. No one wants to bring a huge black hole when the game is released.
from ecmascript.
Related Issues (20)
- cannot read property 'emit_signal' of null when emitting a custom signal HOT 4
- position.x is not mutable and wrong class on godot.register_property crashes godot HOT 1
- 3.5-stable compiles and runs trivial test app HOT 1
- Godot 4 Tracker HOT 31
- Javascript module plans HOT 9
- Debugger Issue
- 可以在3.5支持安卓编辑器吗? HOT 4
- How to extend from Scene HOT 2
- Upgrade to a newer quickjs HOT 3
- JS_GetMollocState typo HOT 2
- Thoughts and comments on moving quickjs to a thirdparty directory? HOT 7
- Support scons custom_modules HOT 3
- Research implementing behave-graph as a Javascript library HOT 1
- How to use it?
- GD4 branch compilation error on Ubuntu 22.04 + Fix HOT 2
- Were JS file access functions left out? HOT 1
- How should a file be accessed? HOT 2
- Make javascript module for Godot Engine 4 production ready HOT 7
- Merge gd4 branch to master HOT 2
- CommonJS Module Support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecmascript.