Skip to content

Commit

Permalink
Fix package.json extension missing in webpack config (electron-react-…
Browse files Browse the repository at this point in the history
…boilerplate#1835)

* Fix package.json extension missing in webpack config

* remove linting rule that enforced json extension be dropped

* explicitly use package.json in scripts instead of ambiguous package extension
  • Loading branch information
afc163 authored and vikr01 committed Oct 17, 2018
1 parent 39375dc commit bd0ec6b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
"flowtype/use-flow-type": "error",
"flowtype/valid-syntax": "error",
"generator-star-spacing": "off",
"import/extensions": [
"error",
"ignorePackages",
{ "js": "never", "jsx": "never", "json": "never" }
],
"import/no-unresolved": "error",
"import/no-extraneous-dependencies": "off",
"jsx-a11y/anchor-is-valid": "off",
Expand Down
6 changes: 3 additions & 3 deletions configs/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import path from 'path';
import webpack from 'webpack';
import fs from 'fs';
import { dependencies as externals } from '../app/package';
import { dependencies as possibleExternals } from '../package';
import { dependencies as externals } from '../app/package.json';
import { dependencies as possibleExternals } from '../package.json';

// Find all the dependencies without a `main` property and add them as webpack externals
function filterDepWithoutEntryPoints(dep: string): boolean {
Expand All @@ -19,7 +19,7 @@ function filterDepWithoutEntryPoints(dep: string): boolean {
return false;
}
const pgkString = fs
.readFileSync(require.resolve(`${dep}/package`))
.readFileSync(require.resolve(`${dep}/package.json`))
.toString();
const pkg = JSON.parse(pgkString);
const fields = ['main', 'module', 'jsnext:main', 'browser'];
Expand Down
2 changes: 1 addition & 1 deletion configs/webpack.config.renderer.dev.dll.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import webpack from 'webpack';
import path from 'path';
import merge from 'webpack-merge';
import baseConfig from './webpack.config.base';
import { dependencies } from '../package';
import { dependencies } from '../package.json';
import CheckNodeEnv from '../internals/scripts/CheckNodeEnv';

CheckNodeEnv('development');
Expand Down
2 changes: 1 addition & 1 deletion internals/scripts/CheckNativeDep.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import fs from 'fs';
import chalk from 'chalk';
import { execSync } from 'child_process';
import { dependencies } from '../../package';
import { dependencies } from '../../package.json';

(() => {
if (!dependencies) return;
Expand Down
2 changes: 1 addition & 1 deletion internals/scripts/ElectronRebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import path from 'path';
import { execSync } from 'child_process';
import fs from 'fs';
import { dependencies } from '../../app/package';
import { dependencies } from '../../app/package.json';

const nodeModulesPath = path.join(__dirname, '..', '..', 'app', 'node_modules');

Expand Down

0 comments on commit bd0ec6b

Please sign in to comment.