Skip to content

Commit 28fbdb3

Browse files
authored
Merge pull request #262 from cnblogs/revert-258-fix-compile-markdown-entry
Revert "chore: fix compile markdown.entry.ts"
2 parents 8fffc44 + a30fcfa commit 28fbdb3

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

ui/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"@/*": ["../src/*"]
1717
},
1818
"lib": ["DOM", "ES2020"],
19-
"strictBindCallApply": true,
20-
"rootDir": "../"
19+
"strictBindCallApply": true
2120
},
2221
"include": ["./**/*.ts", "./**/*.tsx", "./**/*.jsx", "./**/*.js", "*.mjs", "../src/model/*.ts"],
2322
"exclude": ["./dist"]

ui/webpack.config.mjs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const buildEntry = () => {
1818
.filter(x => x.isDirectory() && !['share', 'dist', 'lib'].includes(x.name))
1919
.map(x => x.name)
2020
for (let folder of folders) {
21-
const key = `assets/ui/${folder}/index`
21+
const key = `${folder}/index`
2222
entries[key] = `./ui/${folder}/index.tsx`
2323
cpSync(`./ui/${folder}/index.html`, `./dist/assets/ui/${folder}/index.html`, { force: true })
2424
}
@@ -28,8 +28,8 @@ const buildEntry = () => {
2828

2929
cpSync('./node_modules/@fluentui/font-icons-mdl2/fonts/', './dist/assets/fonts/', { recursive: true })
3030

31-
entries['markdown'] = './src/markdown/markdown.entry.ts'
32-
console.log(entries)
31+
if (isDevEnv) console.log(entries)
32+
3333
return entries
3434
}
3535

@@ -39,16 +39,15 @@ const buildEntry = () => {
3939
const config = {
4040
entry: buildEntry(),
4141
output: {
42-
path: path.resolve('dist'), //打包后的文件存放的地方
42+
path: path.resolve('dist/assets/ui'), //打包后的文件存放的地方
4343
filename: '[name].js', //打包后输出文件的文件名
4444
},
4545
resolve: {
46-
extensions: ['.tsx', '.ts', 'less', '.css', '.js', '.mjs'],
46+
extensions: ['.tsx', '.ts', 'less', '.css', '.js'],
4747
plugins: [new TsconfigPathsPlugin({ configFile: './ui/tsconfig.json' })],
4848
},
4949
devtool: isDevEnv ? 'eval-source-map' : false,
5050
mode: isDevEnv ? 'development' : 'production',
51-
target: 'web',
5251
module: {
5352
rules: [
5453
{
@@ -95,12 +94,6 @@ const config = {
9594
test: /\.tsx?$/,
9695
use: 'ts-loader',
9796
},
98-
{
99-
test: /\.mjs/,
100-
resolve: {
101-
fullySpecified: false,
102-
},
103-
},
10497
],
10598
},
10699
performance: {

webpack.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default (env, { mode }) => {
5252
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
5353
mode: mode, // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
5454

55-
entry: { extension: './src/extension.ts' }, // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
55+
entry: { extension: './src/extension.ts', markdown: './src/markdown/markdown.entry.ts' }, // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
5656
output: {
5757
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
5858
path: path.resolve(__dirname, 'dist'),

0 commit comments

Comments
 (0)