Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 83 additions & 46 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions tests/integration/asset/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,72 @@ export { __webpack_exports__bar as bar, __webpack_exports__foo as foo };
"
`;

exports[`use json/yaml/toml 1`] = `
"var json_example_namespaceObject = JSON.parse('{"u":"foo","e":[1,2]}');
const toml_example = {
hello: "world",
foo: {
bar: "baz"
}
};
const yaml_example = {
hello: 'world',
foo: {
bar: 'baz'
}
};
console.log(json_example_namespaceObject.u);
console.log(json_example_namespaceObject.e);
console.log(yaml_example.hello);
console.log(yaml_example.foo);
console.log(toml_example.hello);
console.log(toml_example.foo);
"
`;

exports[`use json/yaml/toml 2`] = `
"import * as __WEBPACK_EXTERNAL_MODULE__assets_json_example_js_f9233e35__ from "./assets/json-example.js";
import * as __WEBPACK_EXTERNAL_MODULE__assets_toml_example_js_83d79853__ from "./assets/toml-example.js";
import * as __WEBPACK_EXTERNAL_MODULE__assets_yaml_example_js_f81ac546__ from "./assets/yaml-example.js";
console.log(__WEBPACK_EXTERNAL_MODULE__assets_json_example_js_f9233e35__.name);
console.log(__WEBPACK_EXTERNAL_MODULE__assets_json_example_js_f9233e35__["default"].items);
console.log(__WEBPACK_EXTERNAL_MODULE__assets_yaml_example_js_f81ac546__["default"].hello);
console.log(__WEBPACK_EXTERNAL_MODULE__assets_yaml_example_js_f81ac546__["default"].foo);
console.log(__WEBPACK_EXTERNAL_MODULE__assets_toml_example_js_83d79853__["default"].hello);
console.log(__WEBPACK_EXTERNAL_MODULE__assets_toml_example_js_83d79853__["default"].foo);
"
`;

exports[`use json/yaml/toml 3`] = `
"var json_example_rslib_entry_namespaceObject = JSON.parse('{"name":"foo","items":[1,2]}');
var __webpack_exports__items = json_example_rslib_entry_namespaceObject.items;
var __webpack_exports__name = json_example_rslib_entry_namespaceObject.name;
export { __webpack_exports__items as items, __webpack_exports__name as name };
"
`;

exports[`use json/yaml/toml 4`] = `
"const yaml_example_rslib_entry_ = {
hello: 'world',
foo: {
bar: 'baz'
}
};
export { yaml_example_rslib_entry_ as default };
"
`;

exports[`use json/yaml/toml 5`] = `
"const toml_example_rslib_entry_ = {
hello: "world",
foo: {
bar: "baz"
}
};
export { toml_example_rslib_entry_ as default };
"
`;

exports[`use source.assetInclude 1`] = `
"import draft_namespaceObject from "./static/assets/draft.txt";
console.log(draft_namespaceObject);
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/asset/hash/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "asset-name-test",
"name": "asset-hash-test",
"version": "1.0.0",
"private": true,
"type": "module",
Expand Down
Loading
Loading