MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / test_webpack

Method test_webpack

test/test_browser.py:5568–5581  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

5566 })
5567 @requires_dev_dependency('webpack')
5568 def test_webpack(self, args):
5569 if '-sEXPORT_ES6' in args:
5570 copytree(test_file('webpack_es6'), '.')
5571 outfile = 'src/hello.mjs'
5572 else:
5573 copytree(test_file('webpack'), '.')
5574 outfile = 'src/hello.js'
5575 self.compile_btest('hello_world.c', ['-sEXIT_RUNTIME', '-sMODULARIZE', '-sENVIRONMENT=web', '-o', outfile] + args)
5576 self.run_process(shared.get_npm_cmd('webpack') + ['--mode=development', '--no-devtool'])
5577 if not self.is_wasm2js():
5578 # Webpack doesn't bundle the wasm file by default so we need to copy it
5579 # TODO(sbc): Look into plugins that do bundling.
5580 shutil.copy('src/hello.wasm', 'dist/')
5581 self.run_browser('dist/index.html', '/report_result?exit:0')
5582
5583 @also_with_pthreads
5584 @requires_dev_dependency('vite')

Callers

nothing calls this directly

Calls 7

copytreeFunction · 0.90
test_fileFunction · 0.90
compile_btestMethod · 0.80
run_processMethod · 0.80
is_wasm2jsMethod · 0.80
run_browserMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected