Giter Site home page Giter Site logo

arraybuffer-loader's Introduction

arraybuffer-loader   npm build License

📀 ArrayBuffer loader for webpack

Supported Platforms

  • Modern Browsers (IE >= 10)
  • Node.js

Getting Started

$ yarn add arraybuffer-loader

or

$ npm install arraybuffer-loader --save-dev

Usage

If you read only the specific extensions (e.g. wasm), please add loader in webpack.config.js.

module: {
  rules: [
    {
      test: /\.png$/,
      loaders: ['arraybuffer-loader'],
    },
  ],
},

Or if reading an arbitrary extension, use require.

const buffer = require('arraybuffer!./data.dat')
const array = new Uint8Array(buffer)

See also offical document Loaders.

For .wasm file

Webpack 4 or later has embedded WASM parser. So, please set type: 'javascript/auto' when use arraybuffer-loader.

module: {
  rules: [
    {
      test: /\.wasm$/,
      type: 'javascript/auto',
      loaders: ['arraybuffer-loader'],
    },
  ],
},

License

MIT © Pine Mizune

arraybuffer-loader's People

Contributors

fossabot avatar greenkeeper[bot] avatar pine avatar wclr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

arraybuffer-loader's Issues

window.atob is not defined in node

Hi,
I'm using this library with webpack to load .wasm files that need to be executed both on the client and on the server. It works fine on the client, but if I try to execute the code on the server I receive the following error:

TypeError: window.atob is not a function

I think that the problem might be here. Do you think that we can fix that using this package if window.atob is not defined?

An in-range update of webpack is breaking the build 🚨

Version 4.9.1 of webpack was just published.

Branch Build failing 🚨
Dependency webpack
Current Version 4.9.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
  • continuous-integration/appveyor/branch AppVeyor build succeeded Details

Release Notes v4.9.1

Bugfixes

  • fix parameter references in default parameters

Internal changes

  • change test cases to text format
Commits

The new version differs by 11 commits.

  • 94cd709 4.9.1
  • 5feb7e6 Merge pull request #7174 from JLHwung/revise-examples-build-readme
  • 4cd0cf5 Merge pull request #7379 from xtuc/refactor-use-wast-in-tests
  • c513cac Merge pull request #7403 from webpack/fix/7335
  • f22fffd Evaluate arguments in function's scope
  • 55ce143 Add test case
  • 00eafa6 Update mem-access.wat
  • acc45fd refactor: switch to wast
  • 7184bb4 fix: keep decoding in wasm
  • a9d9fee refactor: switch to tests to wast
  • 64db306 docs(examples): add yarn add webpack-cli step

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of webpack-cli is breaking the build 🚨

The devDependency webpack-cli was updated from 3.2.2 to 3.2.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build succeeded (Details).
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 1 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of webpack is breaking the build 🚨

Version 4.14.0 of webpack was just published.

Branch Build failing 🚨
Dependency webpack
Current Version 4.13.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
  • continuous-integration/appveyor/branch AppVeyor build succeeded Details

Release Notes v4.14.0

Features

  • add new hook Compilation.dependencyReference to modify the dependency references

Bugfixes

  • Allow chunks to emit multiple assets to the same filename when hash matches
Commits

The new version differs by 9 commits.

  • 190cf7b 4.14.0
  • 5a185c9 Merge pull request #7585 from webpack/feature/hook-into-get-reference
  • 86370e9 Merge pull request #7625 from webpack/bugfix/multiple-assets-same-file
  • 522b324 allow emitting to the same filename when hash matches
  • 7beac3c Merge branch 'master' into feature/hook-into-get-reference
  • be896f2 fix bug
  • 3502287 emit correct code for reexport unused exports
  • 50fe2e7 add Compilation.getDependencyReference and hooks to override it
  • e1f0a66 add note about webpack 5 refactoring

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Magic Header not present

Hi there, I keep getting the following error with no idea why or what it is, any help guys?

ERROR

in ./app/src/wasm/factorial.wasm (./node_modules/arraybuffer-loader!./app/src/wasm/factorial.wasm)
Module parse failed: magic header not detected
You may need an appropriate loader to handle this file type.
Error: magic header not detected
at new CompileError (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/webassemblyjs/lib/errors.js:40:109)
at parseModuleHeader (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js:234:13)
at Object.decode (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js:1413:3)
at decode (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/@webassemblyjs/wasm-parser/lib/index.js:208:21)
at WebAssemblyParser.parse (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/webpack/lib/wasm/WebAssemblyParser.js:44:15)
at doBuild.err (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/webpack/lib/NormalModule.js:398:32)
at runLoaders (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/webpack/lib/NormalModule.js:280:12)
at /Users/keweijiang/dev_play/electron-react-webpack/node_modules/loader-runner/lib/LoaderRunner.js:370:3
at iterateNormalLoaders (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/loader-runner/lib/LoaderRunner.js:211:10)
at iterateNormalLoaders (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/loader-runner/lib/LoaderRunner.js:218:10)
at /Users/keweijiang/dev_play/electron-react-webpack/node_modules/loader-runner/lib/LoaderRunner.js:233:3
at runSyncOrAsync (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
at iterateNormalLoaders (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/loader-runner/lib/LoaderRunner.js:229:2)
at Array. (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/loader-runner/lib/LoaderRunner.js:202:4)
at Storage.finished (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
at provider (/Users/keweijiang/dev_play/electron-react-webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9)
at /Users/keweijiang/dev_play/electron-react-webpack/node_modules/graceful-fs/graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:503:3)
@ ./app/src/App.jsx 5:13-64
@ ./app/src/renderer_process.js

An in-range update of webpack-cli is breaking the build 🚨

The devDependency webpack-cli was updated from 3.3.2 to 3.3.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: Waiting for AppVeyor build to complete (Details).
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 201 commits.

  • 173d11a chore: v.3.3.3
  • 7071b5c misc: update internal docs
  • 69f7683 chore: monorepo version update
  • efe8c2a chore: update jest snapshots
  • 12a38be chore: monorepo version update
  • 2608179 chore: lockfile updates
  • 25c6e7b chore: v.3.2.2 until mnorepo versioning
  • 67b3dc7 chore: update utils version for init pkg
  • ace0d4a chore: monorepo version update
  • 5c8c6a1 misc: add lerna publish cmnd
  • 16079a1 chore: lerna independent
  • b9711e8 chore: sec fixes
  • 9b78911 chore: sec patch monorepo
  • d577b0c chore: v.3.3.3
  • 4b08819 Merge pull request #925 from anshumanv/prettier/format

There are 201 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of karma is breaking the build 🚨

The devDependency karma was updated from 3.0.0 to 3.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

karma is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build passed (Details).
  • continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Release Notes for v3.1.0

Bug Fixes

Features

  • config: Add config option for browser socket timeout (#3102) (11e3a9d), closes #2927
  • config: add support for ES modules (e811adb)
  • frameworks: report start() errors back to server. (#3126) (8257375)
  • server: .dom files include HTML tags in page. (#3178) (4651524)
  • server: Add public API to force a file refresh (dab8a82)
  • server: Add stop method (#3153) (6d96d8e), closes #3149
  • server: Add support for encoded source files (#3123) (68b37d3)
Commits

The new version differs by 43 commits.

  • 0a2d2e9 chore: release v3.1.0
  • 2385690 chore: update contributors
  • f94284d refactor(lib): use assert library instead of throwing error directly
  • 8542f27 refactor(lib): coffe script support (#3188)
  • 1458267 refactor(lib): small update in lib/emitter_wrapper
  • c311ac0 refactor(server): use ES6 string interpolation wherever possible
  • 7634e71 fix(browser): emit 'browsers_change' in collection (#3183)
  • e811adb feat(config): add support for ES modules
  • 0f8b2b1 fix(config): remove phantomjs in favor of chrome headless (#3175)
  • f28a454 refactor(server): Clearer error messages on fatal errors
  • 4651524 feat(server): .dom files include HTML tags in page. (#3178)
  • 5cc4089 refactor(server): refactoring of stopper (#3174)
  • 8efb28d refactor(server): refactoring of lib/browser (#3171)
  • dab8a82 feat(server): Add public API to force a file refresh
  • 871a1c9 refactor(server): refactoring of watcher (#3173)

There are 43 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of karma is breaking the build 🚨

The devDependency karma was updated from 3.1.1 to 3.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

karma is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: Waiting for AppVeyor build to complete (Details).
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v3.1.2

Bug Fixes

Features

Commits

The new version differs by 11 commits.

  • 7d4d347 chore: release v3.1.2
  • 5077c18 chore: update contributors
  • fb05fb1 fix(server): use flatted for json.stringify (#3220)
  • 2682bff feat(docs): callout the key debug strategies. (#3219)
  • 4e87902 fix(changelog): remove release which does not exist (#3214)
  • 30ff73b fix(browser): report errors to console during singleRun=false (#3209)
  • 5334d1a fix(file-list): do not preprocess up-to-date files (#3196)
  • dc5f5de fix(deps): upgrade sinon-chai 2.x -> 3.x (#3207)
  • d38f344 fix(package): bump lodash version (#3203)
  • ffb41f9 refactor(browser): log state transitions in debug (#3202)
  • 240209f fix(dep): Bump useragent to fix HeadlessChrome version (#3201)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of karma-webpack is breaking the build 🚨

☝️ Greenkeeper’s updated Terms of Service will come into effect on April 6th, 2018.

Version 2.0.10 of karma-webpack was just published.

Branch Build failing 🚨
Dependency karma-webpack
Current Version 2.0.9
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

karma-webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Update README.md with the newest webpack.

module.exports = {
	mode: "development",
  entry: "./example.js",
	output: {
		publicPath: "js/"
	},
	module: {
		rules: [
			{
        test: /\.wasm$/,
        type: 'javascript/auto',
        loaders: ['arraybuffer-loader'],
			}
		]
	},
	optimization: {
		occurrenceOrder: true // To keep filename consistent between different modes (for example building only)
	}
};

loader:

const addModule = require('arraybuffer-loader!./add.wasm')
const array = new Uint8Array(buffer)

console.log(array)

An in-range update of karma is breaking the build 🚨

The devDependency karma was updated from 4.1.0 to 4.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

karma is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build succeeded (Details).
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.2.0

Bug Fixes

  • logging: Util inspect for logging the config. (#3332) (70b72a9)
  • reporter: format stack with 1-based column (#3325) (182c04d), closes #3324
  • server: Add error handler for webserver socket. (#3300) (fe9a1dd)
Commits

The new version differs by 13 commits.

  • 42933c9 chore: release v4.2.0
  • db1ea57 chore: update contributors
  • a1049c6 chore: update eslint packages to latest and fix complaints (#3312)
  • 70b72a9 fix(logging): Util inspect for logging the config. (#3332)
  • 1087926 fix typo: (#3334)
  • 182c04d fix(reporter): format stack with 1-based column (#3325)
  • f0c4677 docs(travis): Correct the docs to also show how to do it on Xenial (#3316)
  • 3aea7ec chore(deps): update core-js -> ^3.1.3 (#3321)
  • 5e11340 chore: revert back to Mocha 4 (#3313)
  • 1205bce chore(test): fix flaky test cases (#3314)
  • 7f40349 Cleanup dependencies (#3309)
  • 7828bea chore: update braces and chokidar to latest versions (#3307)
  • fe9a1dd fix(server): Add error handler for webserver socket. (#3300)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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.