/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/hotCases/loader-import-module/css/index.js
26 строк
719 B
Tobias Koppers
add HMR test case and fix problems with it
14 апр 2021, 17:03
14 апр 2021, 17:03
f46e816
Код
Авторство
О чём код?
import stylesheet from "./stylesheet.css.js"; it("should be able to use build-time code with HMR", done => { expect(stylesheet).toBe( 'body { background: url("https://test.cases/path/assets/file.png"); color: #f00; }' ); NEXT( require("../../update")(done, true, stats => { expect(stylesheet).toBe( 'body { background: url("https://test.cases/path/assets/file.png"); color: #0f0; }' ); NEXT( require("../../update")(done, true, stats => { expect(stylesheet).toBe( 'body { background: url("https://test.cases/path/assets/file.jpg"); color: #0f0; }' ); done(); }) ); }) ); }); if (import.meta.webpackHot) { import.meta.webpackHot.accept("./stylesheet.css.js"); }