Commit Graph

24 Commits

Author SHA1 Message Date
Nathan Adams adebb04e3d web: Removed some unneeded eslint configs 2024-07-08 11:34:35 +02:00
TÖRÖK Attila bffa2e8efd web: Port the selfhosted package to modules 2024-04-08 23:26:04 +02:00
Toad06 19c0bb14d5 web: Only minify ascii characters on selfhosted builds 2023-05-16 21:39:40 +03:00
relrelb 38549fdbdf web: Publish NPM package
Publish nightly releases as part of the CI, so Ruffle can be easily
integrated into a website using a CDN (such as jsDelivr). It would
also be easier for websites to keep up-to-date, as NPM auto-updates
the `latest` tag to refer to the latest release.

A dedicated `package.json` is used for the published NPM package,
because `ruffle-selfhosted` depends on the private `ruffle-core`
package, which shouldn't be published.

Also, the `version` field must monotonically increase. So Webpack
auto-fills it to be `0.1.0-nightly.YYYY.MM.DD`. This format satisfies
a couple of needs:
* Newer nightly releases should take precedence over older ones.
* Stable releases (e.g. `1.0.0`) should take precedence over nightly
ones.
2022-01-12 21:24:19 -08:00
relrelb e5617de4aa web: Suppress Webpack's size limit for .wasm files
Webpack warns on assets larger than 250KB by default. Our WebAssembly
module exceeds this limit by far (it's a few MBs).
2021-12-10 22:50:45 +02:00
relrelb 375269417f web: Set `__webpack_public_path__` in `load-ruffle.ts`
Use wasm-bindgen's built-in loader instead of relying on Webpack.
In order to still respect the `publicPath` config, set
`__webpack_public_path__` just before fetching the WebAssembly module.
This allows to no longer declare `.wasm` files as resource assets in
each `webpack.config.js`.
2021-09-08 02:25:05 -07:00
relrelb 508f541ada Revert "web: Simplify .wasm loading"
This reverts commit 66bfff7687.
2021-07-27 11:19:55 +03:00
relrelb 66bfff7687 web: Simplify .wasm loading
Use wasm-bindgen's built-in loader instead of relying on Webpack.

This allows to no longer declare .wasm files as resource assets in
each webpack.config.js.

Also the bundled JS is a bit smaller (e.g. demo is now ~88KB vs.
~90KB before).
2021-07-24 14:18:19 -07:00
relrelb 49e26338bc web: Fix and cleanup npm build scripts
* Remove `buildProduction` as it was equivalent to `build`.
* Fix `build:avm_debug` and change it to `build:debug`, which also
disables Webpack optimizations.
2021-07-17 11:40:25 +03:00
relrelb 0fa24b4ce0 web: Migrate file-loader to asset modules
file-loader is deprecated and asset modules are the recommended
alternative.
2021-04-21 19:03:19 -07:00
relrelb 201c4f5db0 web: Use relative paths for webpack entries
Only output.path needs to be absolute.
2021-04-21 19:03:19 -07:00
relrelb 690b51f15b web: Shorten CopyWebpackPlugin to CopyPlugin 2021-03-05 23:07:55 -08:00
Mike Welsh f6f7222221 web: Remove clean-webpack-plugin dependency 2021-03-03 06:44:45 -08:00
relrelb 1c21856980
web: General refactoring
* web: Don't load a random SWF Instead, show a prompt to select or drag an SWF.
* web: Refactor webpack.config.js
* demo: Refactor index.js
* demo: Cleanup CSS
2021-02-16 20:39:46 -08:00
Mike Welsh c2b768c453 web: Fallback to instantiate with improper MIME type
Use --target web in wasm-bindgen and file-loader for WASM files,
allowing wasm-bindgen's built-in fallback from
WebAssembly.instantiateStreaming to instantiate.

file-loader spits out the WASM file directly in the output folder,
and imports will resolve to the URL, so that we can load the file
directly, avoiding webpack's built-in wasm loaders.

This allows Ruffle to function on web servers even if they serve
WASM files with the incorrect MIME type, fixing one of our biggest
support requests (#400, #1458). There is some performance impact
on loading with the fallback, but this is preferable to not
working at all.
2021-01-16 15:30:11 -08:00
Nathan Adams 600d267bf3 web: We no longer need git dependency in webpack builds - fixes #1517 2020-11-24 16:36:33 -08:00
Nathan Adams 8abb8df299 web: core no longer uses webpack, but selfhosted still does 2020-11-24 16:36:33 -08:00
Nathan Adams 5ff7168fe9 web: Switched core package from javascript to typescript 2020-11-24 16:36:33 -08:00
Nathan Adams dab79107b2 web: Include git details into the build 2020-11-04 16:46:14 -08:00
Mike Welsh cd96df7ee7 web: Disable automatic publicPath in webpack configs 2020-10-21 15:19:36 -07:00
Mike Welsh 990052db77 chore: Bump to webpack 5 2020-10-17 14:07:28 -07:00
Nathan Adams e466060a50 chore: Copy LICENSE* to relevant places where package managers complain if they don't exist, and make sure they're included in distributions 2020-05-27 00:11:02 -07:00
Nathan Adams e9a394ac27 web: Only core will build ruffle, the other packages will use that 2020-05-19 11:42:54 +02:00
Nathan Adams b6523324ed web: Move each web package into a packages/ directory 2020-05-19 11:42:53 +02:00