Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: move to ESM-only and fix package exports (#3380)
Co-authored-by: userquin <userquin@gmail.com> Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com> Co-authored-by: Chris <1633711653@qq.com> Co-authored-by: Anthony Fu <github@antfu.me>
- Loading branch information
1 parent
a1069ce
commit 41bc87b
Showing
93 changed files
with
1,283 additions
and
5,165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
const process = require('node:process') | ||
const UnoCSS = require('@unocss/webpack').default | ||
|
||
module.exports = { | ||
configureWebpack: { | ||
plugins: [ | ||
UnoCSS({}), | ||
], | ||
}, | ||
chainWebpack(config) { | ||
config.module.rule('vue').uses.delete('cache-loader') | ||
config.module.rule('tsx').uses.delete('cache-loader') | ||
config.merge({ | ||
cache: false, | ||
}) | ||
}, | ||
css: { | ||
extract: process.env.NODE_ENV === 'development' | ||
? { | ||
filename: '[name].css', | ||
} | ||
: { | ||
filename: '[name].[hash:9].css', | ||
}, | ||
}, | ||
module.exports = function () { | ||
return import('@unocss/webpack').then((m) => { | ||
const UnoCSS = m.default | ||
return { | ||
configureWebpack: { | ||
plugins: [ | ||
UnoCSS({}), | ||
], | ||
}, | ||
chainWebpack(config) { | ||
config.module.rule('vue').uses.delete('cache-loader') | ||
config.module.rule('tsx').uses.delete('cache-loader') | ||
config.merge({ | ||
cache: false, | ||
}) | ||
}, | ||
css: { | ||
extract: process.env.NODE_ENV === 'development' | ||
? { | ||
filename: '[name].css', | ||
} | ||
: { | ||
filename: '[name].[hash:9].css', | ||
}, | ||
}, | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
const process = require('node:process') | ||
const UnoCSS = require('@unocss/webpack').default | ||
|
||
module.exports = { | ||
configureWebpack: { | ||
devtool: 'inline-source-map', | ||
plugins: [ | ||
UnoCSS(), | ||
], | ||
optimization: { | ||
realContentHash: true, | ||
}, | ||
}, | ||
chainWebpack(config) { | ||
config.module.rule('vue').uses.delete('cache-loader') | ||
config.module.rule('tsx').uses.delete('cache-loader') | ||
config.merge({ | ||
cache: false, | ||
}) | ||
}, | ||
css: { | ||
extract: process.env.NODE_ENV === 'development' | ||
? { | ||
filename: 'css/[name].css', | ||
chunkFilename: 'css/[name].css', | ||
} | ||
: true, | ||
}, | ||
module.exports = function () { | ||
return import('@unocss/webpack').then((m) => { | ||
const UnoCSS = m.default | ||
return { | ||
configureWebpack: { | ||
devtool: 'inline-source-map', | ||
plugins: [ | ||
UnoCSS(), | ||
], | ||
optimization: { | ||
realContentHash: true, | ||
}, | ||
}, | ||
chainWebpack(config) { | ||
config.module.rule('vue').uses.delete('cache-loader') | ||
config.module.rule('tsx').uses.delete('cache-loader') | ||
config.merge({ | ||
cache: false, | ||
}) | ||
}, | ||
css: { | ||
extract: process.env.NODE_ENV === 'development' | ||
? { | ||
filename: 'css/[name].css', | ||
chunkFilename: 'css/[name].css', | ||
} | ||
: true, | ||
}, | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,4 @@ export default defineBuildConfig({ | |
externals: [ | ||
'astro', | ||
], | ||
rollup: { | ||
emitCJS: true, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,4 @@ export default defineBuildConfig({ | |
'pug', | ||
'@unocss/core', | ||
], | ||
rollup: { | ||
emitCJS: true, | ||
}, | ||
}) |
Oops, something went wrong.