Skip to content

Commit

Permalink
feat: prepare publish at store
Browse files Browse the repository at this point in the history
  • Loading branch information
masuP9 committed Sep 23, 2019
1 parent 7705e3f commit 3b7fc10
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"devDependencies": {
"@types/node": "^12.7.5",
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@types/react-redux": "^7.1.2",
Expand All @@ -21,8 +22,9 @@
"webpack-cli": "^3.3.9"
},
"scripts": {
"build": "webpack",
"watch": "webpack -w"
"build": "webpack --mode development",
"prod": "webpack --mode production",
"watch": "webpack --mode development -w"
},
"dependencies": {
"react": "^16.9.0",
Expand Down
File renamed without changes
5 changes: 5 additions & 0 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"name": "Noalte",
"description": "alt text editor for note",
"version": "0.0.1",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"content_scripts": [
{
"matches": [
Expand Down
18 changes: 13 additions & 5 deletions src/scripts/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ import { createStore, applyMiddleware } from 'redux';
import { rootReducer } from './reducer';
import { createLogger } from 'redux-logger';

const logger = createLogger({
diff: true,
collapsed: true,
});
const middlewares = [];

export const store = createStore(rootReducer, applyMiddleware(logger));
if (process.env.NODE_ENV === `development`) {
const { createLogger } = require(`redux-logger`);

middlewares.push(
createLogger({
diff: true,
collapsed: true,
}),
);
}

export const store = createStore(rootReducer, applyMiddleware(...middlewares));
2 changes: 0 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const CopyPlugin = require('copy-webpack-plugin');
const IS_PRODUCTION = process.env.NODE_ENV === 'production';

module.exports = {
mode: IS_PRODUCTION ? 'production' : 'development',
// Enable sourcemaps for debugging webpack's output.
devtool: IS_PRODUCTION ? null : 'source-map',
entry: './src/scripts/main.tsx',
output: { filename: 'content_script.js' },
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,11 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636"
integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==

"@types/node@^12.7.5":
version "12.7.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.5.tgz#e19436e7f8e9b4601005d73673b6dc4784ffcc2f"
integrity sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==

"@types/prop-types@*":
version "15.7.2"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.2.tgz#0e58ae66773d7fd7c372a493aff740878ec9ceaa"
Expand Down

0 comments on commit 3b7fc10

Please sign in to comment.