Skip to content

Commit

Permalink
feat(Lib Requires): Fix require problems with __non_webpack_require__…
Browse files Browse the repository at this point in the history
… and also fix lib properties in package.json
  • Loading branch information
Guilherme Ventura committed Mar 6, 2020
1 parent 4f1bd30 commit 5475de1
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 189 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.DS_Store
lib
15 changes: 0 additions & 15 deletions lib/files/.editorconfig

This file was deleted.

84 changes: 0 additions & 84 deletions lib/files/.eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions lib/files/.prettierrc.js

This file was deleted.

15 changes: 0 additions & 15 deletions lib/files/.vscode/settings.json

This file was deleted.

56 changes: 0 additions & 56 deletions lib/files/package.json

This file was deleted.

1 change: 0 additions & 1 deletion lib/index.js

This file was deleted.

12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"author": "Guilherme Ventura de Souza",
"license": "MIT",
"bin": {
"update-linters": "./lib/index.js"
"update-linters": "lib/index.js"
},
"scripts": {
"clean": "rimraf lib && rimraf dist",
"build": "rimraf lib && webpack --mode production && rimraf dist",
"prepublish": "yarn clean && yarn build && rimraf dist",
"clean": "rimraf lib",
"build": "rimraf lib && webpack --mode production",
"prepublish": "yarn clean && yarn build",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
"test": "echo \"Error: no tests specified yet\"",
"release": "np --any-branch"
Expand Down Expand Up @@ -51,9 +51,7 @@
"fs": false
},
"files": [
"lib/index.js",
"lib/files/*",
"lib/files/.vscode/*"
"lib"
],
"engines": {
"node": ">=10"
Expand Down
4 changes: 1 addition & 3 deletions src/helpers/cli-args.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const yargs = require('yargs')

const argv = yargs
module.exports = yargs
.option('VSCODE', {
alias: 'vsc',
description: 'Update .vscode settings',
Expand Down Expand Up @@ -34,5 +34,3 @@ const argv = yargs
.help()
.alias('help', 'h')
.showHelpOnFail(false, 'Specify --help for available options').argv

module.exports = argv
4 changes: 3 additions & 1 deletion src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ function mergeObject(source, target) {
function readJS(path) {
return new Promise(resolve => {
try {
const file = require(path)
// eslint-disable-next-line no-undef
const file = __non_webpack_require__(path)
resolve(file)
} catch (err) {
console.log('erro ', path)
resolve(err)
}
})
Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const webpack = require('webpack')
const CopyFiles = require('copy-webpack-plugin')
const distPath = 'lib'
const path = require('path')
Expand Down

0 comments on commit 5475de1

Please sign in to comment.