Comments (5)
I'm only thinking "copy files manually from unpkg" but that isn't really professional ...
There's nothing wrong with that, tbh.
You can clone the repo, build it, then use something like yalc
to publish & install locally. That seems to be what you're after?
from htm.
Thanks. I believe I will use Vite with preact as "external" in order not to bundle it, and use some kind of manual copying mechanism from my node_modules.
Thank you dearly for you support!
from htm.
Hmm ... OK; this works. Almost.
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import fs from 'fs';
import alias from '@rollup/plugin-alias';
export default defineConfig({
plugins: [preact()],
build: {
rollupOptions: {
external: [
'./preact-htm/standalone.module.js'
],
output: {
entryFileNames: '[name].bundle.js',
assetFileNames: '[name].[ext]',
chunkFileNames: '[name].[ext]'
},
plugins: [
{
name: 'copy-files',
generateBundle: () => fs.copyFileSync('node_modules/htm/preact/standalone.module.js', '../wwwroot/preact-htm/standalone.module.js')
},
alias({
entries: [
{ find: '@preact-htm', replacement: './preact-htm/standalone.module.js' }
]
})
]
},
sourcemap: true,
outDir: '../wwwroot'
}
});
Now, my problem is that the standalone module (with both HTM and Preact prepackaged) does not include eg. hooks. How to do this? I'm guessing just package it yourself?
eg #134
from htm.
Oh, wait, the standalone does include them! You just don't need to import 'preact/hooks'. I think we're good here!
from htm.
from htm.
Related Issues (20)
- Some event handler converts to boolean
- isnt rendering in htm HOT 5
- Find a way to allow "@" in attribute?
- createRef not available via unpkg HOT 1
- Syntax highlighting for Sublime Text? HOT 1
- async function is not renderd HOT 1
- just a small note: standalone bundle of htm with preact and preact/signals HOT 2
- different attribute handling in div/span etc. and svg HOT 5
- Zero is translated as empty string when htm is bound to vhtml HOT 1
- https://mobidrivems.page.link/?link=https://mobidrive.com/sharelink/u/6uCDyxQyzUTH0BaAaUu4Jn5sdtlGxm32pJYzqnYSgR9n?sharelink%3D6uCDyxQyzUTH0BaAaUu4Jn5sdtlGxm32pJYzqnYSgR9n&isi=1558848373&ibi=com.mobisystems.MobiDrive&cid=176997065316222436&_fpb=CKwGEPcCGgVuYi1OTw==&_cpt=cpit&_iumenbl=1&_iumchkactval=1&_plt=1072&_uit=4490&_cpb=1&_icp=1 HOT 2
- Difficulty combining htm with preact and material ui HOT 2
- type of htm/preact and htm directly are different HOT 1
- no build preact/htm from browser and no modules HOT 1
- possibility to return monomorphic shape?
- Rádio online
- Some documentation would be nice
- html string added in template form treated as string, not html HOT 1
- Hooks Problem HOT 7
- Trimming newlines near elements
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htm.