smapiot / piral-cli-vite Goto Github PK
View Code? Open in Web Editor NEWPackages for the piral-cli-vite bundler plugin.
Home Page: https://docs.piral.io
License: MIT License
Packages for the piral-cli-vite bundler plugin.
Home Page: https://docs.piral.io
License: MIT License
For more information, see the CONTRIBUTING
guide.
https://stackblitz.com/edit/vitejs-vite-rds4k3?file=src%2FApp.tsx
Browser environment, in this instance
"piral-cli": "^1.4.2",
"piral-cli-vite": "1.0.3",
"piral-core": "^1.4.2",
"vite": "^5.0.8",
"vite-tsconfig-paths": "^4.2.2"
When running piral debug
, the vite-tsconfig-paths
plugin does not seem to be working. Aliased imports are failing.
It seems as if vite.config.js
is not being loaded at all.
The alias @src
is defined in tsconfig.json
and loaded through tsconfigPaths()
vite plugin.
piral debug
Bold test text should be visible at the top left of the layout
Project starts, but Bold test is missing and terminal is showing errors about a failing import
--
For more information, see the CONTRIBUTING
guide.
I would like to define the Angular dependencies within the app shell in order to share them with the pilets. If the reproduction steps defined in the next step are executed, the following error message occurs:
๐ฆ piral-cli v1.0.2
โน Bundle emulator ...
vite v2.9.16 building for production...
transforming...
โ 451 modules transformed.
[vite:esbuild-transpile] Transform failed with 1 error:
assets/index.be692293.js:29639:8: ERROR: Expected ";" but found "changes"Expected ";" but found "changes"
29637| * ReturnsObservable
ofQueryList
notifying the subscriber of changes.
29638| */
29639| get changes() {
| ^
29640| return this._changes || (this._changes = new EventEmitter());
29641| }โ [0174] The bundling process failed: Transform failed with 1 error:
assets/index.be692293.js:29639:8: ERROR: Expected ";" but found "changes"
๐ Find detailed descriptions at https://docs.piral.io/code/search
mkdir test
cd test
piral new --bundler vite --npm-client yarn --target .
dependencies
) within the package.json{
"@angular/common": "^15",
"@angular/compiler": "^15",
"@angular/core": "^15",
"@angular/router": "^15",
"@angular/platform-browser": "^15",
"@angular/platform-browser-dynamic": "^15",
"core-js": "^3.19.0",
"rxjs": "^7.4",
"zone.js": "~0.13.0"
}
importmap.imports
) within the package.json{
"@angular/common": ".",
"@angular/compiler": ".",
"@angular/core": ".",
"@angular/platform-browser": ".",
"@angular/platform-browser-dynamic": ".",
"@angular/router": ".",
"rxjs": "."
}
yarn install
piral build
The app shell is built successfully.
An error message is thrown because a ;
is expected but changes
was found.
If Angular is used in version 15, this problem does not occur.
[Package Version, OS, Browser, ...]
piral: 1.3.3
piral-cli: 1.3.3
piral-cli-vite: 1.0.1
OS: Windows,
Browser: Chrome 119
Cannot use piral-cli-vite
with Vue.js framework. Extending Vite config is also not working correctly.
shell
partmfe1
partpiral-cli-vite
should work correctly using extended config via vite.config.js
(including for example plugins like @vitejs/plugin-vue
) and pilet should start locally and render Vue components using piral-vue-3
converter.
piral-cli-vite
is not working / bundling correctly while using extended config vite.config.js
with @vitejs/plugin-vue
to render Vue component (using piral-vue-3
converter)
As discussed on Gitter (https://app.gitter.im/#/room/#piral-io_community:gitter.im), we could improve a little bit piral-cli-vite
package for easier Vite configuration modification via vite.config.js
For more information, see the CONTRIBUTING
guide.
If the piral new
command is executed without the --bundler
flag followed by the piral build
command and then for example vite is selected, the following error message is issued:
โ [0002] Could not install the package "piral-cli-vite@^1" using yarn. Make sure yarn is correctly installed and accessible: Error: warning package.json: No license field
warning [email protected]: No license field
error Couldn't find any versions for "piral-cli-vite" that matches "^1"
warning package.json: No license field
warning [email protected]: No license field
error Couldn't find any versions for "piral-cli-vite" that matches "^1"
๐ Find detailed descriptions at https://docs.piral.io/code/search
mkdir test
cd test
piral new --npm-client yarn --target .
piral build
I would expect the bundler to be installed.
An error message is thrown that there is no version of the bundler that matches ^1
.
The version of bundler has not yet been updated to the new major version.
piral new
, use the --bundler
flagnpm i
or yarn
Currently, it seems that only vite.config.js files are supported. But it would be great if vite.config.ts files could be used as well.
The best argument for me is, that vitejs does support this out of the box and it is an expected behavior if one creates a Piral project using TS + Vite to have support for config files in TS too.
[Package Version, OS, Browser, ...]
piral
: 1.3.3
piral-cli
: 1.3.3
piral-cli-vite
: latest (1.0.0)
OS: macOS 13,
Browser: Chrome 118.0.5993.117 ARM64
Sourcemaps are not being properly generated when using vite as a pilet bundler.
Message regarding the pilet plugin not generating a sourceamp should not appear in terminal
Output should have sourcemaps (be searchable in Chrome Dev Tools, debuggable in VSCode)
The following message shows in terminal when running the pilet:
(pilet plugin) Sourcemap is likely to be incorrect: a plugin (pilet) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
Sourcemaps are not generated, unable to set breakpoints in VSCode after launching it against the app in development, unable to view the mapped files in Chrome Dev Tools
[Package Version, OS, Browser, ...]
piral: 1.3.3
piral-cli: 1.3.3
piral-cli-vite: 1.0.2
OS: Windows,
Browser: Chrome 119
[Description of the bug]
Vue components CSS styles cannot be loaded while using piral-cli-vite
with piral-vue-3
ERR Error: Invalid URI "/0/style.css?_=0.48254091596936854"
GET /$pilet-api/0/style.css?_=0.48254091596936854
CSS styles from Vue components (Page1.vue) should be applied and work correctly.
CSS styles from Vue component are not applied with error ERR Error: Invalid URI "/0/style.css?
As discussed on Gitter, maybe it's related to way how CSS styles are injected in vite pilets, eg.
As a workaround for now (but not efficient regarding final build) is to override Vite config like below:
// vite.config.js
const pluginVue = require("@vitejs/plugin-vue");
module.exports = function (config) {
config.plugins.push(pluginVue());
// avoid using hashes to reference correctly to pilet CSS file
config.build.rollupOptions.output.assetFileNames = "[name][extname]";
return config;
};
Would be great to improve vite pilet CSS inject way to avoid the above issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.