-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update setup for consistent codewell packaging
Updates the project to use similar setup as the one generated by the new-package script.
- Loading branch information
Showing
11 changed files
with
7,595 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
.npmrc | ||
.npmrc | ||
lib |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
src | ||
tests | ||
.prettierrc | ||
rollup.config.js |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("./lib/prod"); | ||
} else { | ||
module.exports = require("./lib/dev"); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import babel from "rollup-plugin-babel"; | ||
import resolve from "rollup-plugin-node-resolve"; | ||
import commonjs from "rollup-plugin-commonjs"; | ||
import replace from "@rollup/plugin-replace"; | ||
import peerDepsExternal from "rollup-plugin-peer-deps-external"; | ||
|
||
const NODE_ENV = process.env.NODE_ENV || "development"; | ||
const outputFile = NODE_ENV === "production" ? "./lib/prod.js" : "./lib/dev.js"; | ||
const extensions = [".js"]; | ||
|
||
export default { | ||
input: "./src/index.js", | ||
output: { | ||
file: outputFile, | ||
format: "cjs" | ||
}, | ||
plugins: [ | ||
peerDepsExternal(), | ||
replace({ | ||
"process.env.NODE_ENV": JSON.stringify(NODE_ENV) | ||
}), | ||
babel({ | ||
exclude: "node_modules/**", | ||
presets: [["@babel/preset-env", { modules: false }]], | ||
extensions | ||
}), | ||
resolve({ | ||
extensions | ||
}), | ||
commonjs() | ||
] | ||
}; |
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,9 +1,5 @@ | ||
const loadState = require('./loadState'); | ||
const purgeState = require('./purgeState'); | ||
const saveState = require('./saveState'); | ||
import loadState from "./loadState"; | ||
import purgeState from "./purgeState"; | ||
import saveState from "./saveState"; | ||
|
||
module.exports = { | ||
loadState, | ||
purgeState, | ||
saveState, | ||
}; | ||
export { loadState, purgeState, saveState }; |
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ const saveState = (state, storageKey) => { | |
} | ||
}; | ||
|
||
module.exports = saveState; | ||
export default saveState; |