Skip to content

Commit

Permalink
fix: webpack.dev.js -> webpack.dev.conf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 committed Jun 28, 2021
1 parent 0f82ad0 commit 9690e76
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import vite from 'vite';

export interface Config {
rootDir?: string;
projectType?: string;
Expand All @@ -11,7 +9,7 @@ export interface DevServer {
host?: string;
open?: boolean;
port?: number;
proxy?: Record<string, string | vite.ProxyOptions>;
proxy?: any;
public?: string;
}

Expand Down
2 changes: 1 addition & 1 deletion src/config/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function parseWebpackConfig (
}
// default config files: webpack.base.js、webpack.dev.js、webpack.prod.js|webpack.build.js|webpack.production.js
// TODO: production config
const devConfigPath = path.resolve(buildDir, 'webpack.dev.js')
const devConfigPath = path.resolve(buildDir, 'webpack.dev.conf.js')
if (!fs.existsSync(devConfigPath)) {
console.error(`${devConfigPath} not exists`)
return webpackConfig
Expand Down
4 changes: 2 additions & 2 deletions tests/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ test('parse webpack.config.js', async () => {
expect(webpackConfig.entry).toEqual('./main.js');
});

test('parse build/webpack.dev.js', async () => {
test('parse build/webpack.dev.conf.js', async () => {
let webpackConfig: WebpackConfig = {};
const filePath = path.resolve('tests/testdata/webpack/build/webpack.dev.js');
const filePath = path.resolve('tests/testdata/webpack/build/webpack.dev.conf.js');
await parseWebpackConfig(filePath).then(res => {
webpackConfig = res
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const webpack = require('webpack')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.js')
const baseWebpackConfig = require('./webpack.base.conf.js')

const entry = {
app: './src/app.js'
Expand Down

0 comments on commit 9690e76

Please sign in to comment.