Skip to content

Commit

Permalink
Merge 836fa1b into 98a1ef1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Nov 1, 2023
2 parents 98a1ef1 + 836fa1b commit 0868d25
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

</script>
<script type="module">
import mql from './dist/lightweight.mjs'
import mql from './lightweight/index.js'

function getBrowser() {
var ua = navigator.userAgent,
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"c8": "latest",
"ci-publish": "latest",
"conventional-github-releaser": "latest",
"esm": "latest",
"execa": "latest",
"git-authors-cli": "latest",
"ky": "latest",
Expand All @@ -79,7 +78,6 @@
"prettier-standard": "latest",
"rollup": "latest",
"rollup-plugin-filesize": "latest",
"rollup-plugin-magic-string": "latest",
"rollup-plugin-rewrite": "latest",
"rollup-plugin-visualizer": "latest",
"simple-git-hooks": "latest",
Expand All @@ -101,14 +99,13 @@
],
"scripts": {
"build": "rollup -c rollup.config.js --bundleConfigAsCjs",
"build:kys": "[ -f src/ky.js ] || rollup node_modules/ky/distribution/index.js --format=umd --name=ky --exports=named --file=src/ky.js",
"clean": "rm -rf node_modules",
"clean:build": "rm -rf dist lightweight/index.js",
"contributors": "(npx git-authors-cli && npx finepack --sort-ignore-object-at ava && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
"dev": "npm run build -- -w",
"lint": "standard && tsd",
"postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
"prebuild": "npm run clean:build && npm run build:kys",
"prebuild": "npm run clean:build",
"prerelease": "npm run update:check",
"pretest": "npm run lint && npm run build",
"release": "standard-version -a",
Expand Down
12 changes: 7 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import filesize from 'rollup-plugin-filesize'
import replace from '@rollup/plugin-replace'
import rewrite from 'rollup-plugin-rewrite'
import terser from '@rollup/plugin-terser'
import MagicString from 'magic-string'

const rewriteFlattie = () =>
rewrite({
find: /.* from 'flattie'/gm,
replace: match =>
new MagicString(match[0]).replace('import', 'import * as').toString()
replace: match => match[0].replace('import', 'import * as')
})

const build = ({ input, output, plugins = [], compress }) => {
Expand All @@ -27,7 +25,12 @@ const build = ({ input, output, plugins = [], compress }) => {
}),
commonjs(),
...plugins,
compress && terser(),
compress &&
terser({
format: {
comments: false
}
}),
filesize(),
visualizer()
]
Expand All @@ -46,7 +49,6 @@ const builds = [
input: 'src/lightweight.js',
output: { file: 'lightweight/index.js', format: 'es' },
plugins: [
rewriteFlattie(),
nodeResolve({
mainFields: ['browser', 'module', 'main']
})
Expand Down
3 changes: 1 addition & 2 deletions src/lightweight.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

const urlHttp = require('url-http/lightweight')
const { flattie: flatten } = require('flattie')

const factory = require('./factory')
const { default: ky } = require('./ky')
const { default: ky } = require('ky')

class MicrolinkError extends Error {
constructor (props) {
Expand Down

0 comments on commit 0868d25

Please sign in to comment.