Created
March 6, 2020 03:28
-
-
Save wildfrontend/c89363756788e9ba3f4249afd4196e25 to your computer and use it in GitHub Desktop.
2020 rollup app config.js
This file contains hidden or 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
{ | |
"name": "", | |
"version": "0.1.0", | |
"description": "", | |
"scripts": { | |
"build": "rollup -c", | |
"dev": "rollup -c -w", | |
"test": "jest", | |
"clear": "taskkill /f /im node.exe || killall -9 node", | |
"fontmini": "node utils/fontMinify" | |
}, | |
"peerDependencies": { | |
"react": "^16.9.0", | |
"react-dom": "^16.9.0" | |
}, | |
"devDependencies": { | |
"@babel/core": "^7.6.2", | |
"@babel/preset-env": "^7.6.2", | |
"@babel/preset-react": "^7.0.0", | |
"@rollup/plugin-json": "^4.0.0", | |
"@rollup/plugin-url": "^4.0.1", | |
"babel-plugin-module-resolver": "^4.0.0", | |
"http-proxy-middleware": "^0.20.0", | |
"node-sass": "^4.13.1", | |
"postcss-import": "^12.0.1", | |
"postcss-preset-env": "^6.7.0", | |
"rollup": "^1.23.1", | |
"rollup-plugin-babel": "^4.3.3", | |
"rollup-plugin-browsersync": "^1.1.0", | |
"rollup-plugin-commonjs": "^10.1.0", | |
"rollup-plugin-filesize": "^6.2.0", | |
"rollup-plugin-image": "^1.0.2", | |
"rollup-plugin-node-builtins": "^2.1.2", | |
"rollup-plugin-node-globals": "^1.4.0", | |
"rollup-plugin-node-resolve": "^5.2.0", | |
"rollup-plugin-postcss": "^2.0.3", | |
"rollup-plugin-replace": "^2.2.0", | |
"rollup-plugin-visualizer": "^3.3.1" | |
}, | |
"dependencies": { | |
"@emotion/core": "^10.0.27", | |
"@emotion/styled": "^10.0.27", | |
"emotion": "^10.0.27", | |
"react": "^16.10.2", | |
"react-dom": "^16.10.2", | |
}, | |
"browserslist": { | |
"production": [ | |
">0.2%", | |
"not dead", | |
"not op_mini all" | |
], | |
"development": [ | |
"last 1 chrome version", | |
"last 1 firefox version", | |
"last 1 safari version" | |
] | |
} | |
} |
This file contains hidden or 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
import babel from 'rollup-plugin-babel' | |
import commonjs from 'rollup-plugin-commonjs' | |
import replace from 'rollup-plugin-replace' | |
import resolve from 'rollup-plugin-node-resolve' | |
import json from '@rollup/plugin-json' | |
import builtins from 'rollup-plugin-node-builtins' | |
import url from '@rollup/plugin-url' | |
// import visualizer from 'rollup-plugin-visualizer' | |
import filesize from 'rollup-plugin-filesize' | |
import browsersync from 'rollup-plugin-browsersync' | |
import postcss from 'rollup-plugin-postcss' | |
import atImport from 'postcss-import' | |
import postcssPresetEnv from 'postcss-preset-env' | |
import proxy from 'http-proxy-middleware' | |
export default { | |
input: 'src/index.js', | |
output: { | |
file: 'public/bundle.js', | |
name: 'egamelobby', | |
format: 'umd', | |
sourcemap: true, | |
}, | |
plugins: [ | |
json(), | |
builtins(), | |
replace({ | |
'process.env.NODE_ENV': JSON.stringify('production'), | |
}), | |
babel(), | |
resolve(), | |
url({ | |
include: ['**/*.woff'], | |
}), | |
postcss({ | |
extract: true, | |
plugins: [ | |
atImport({}), | |
postcssPresetEnv({ | |
stage: 3, | |
features: { | |
'nesting-rules': true, | |
}, | |
}), | |
], | |
sourceMap: 'inline', | |
}), | |
commonjs({ | |
include: 'node_modules/**', | |
namedExports: { | |
'node_modules/react/index.js': [ | |
'cloneElement', | |
'isValidElement', | |
'Component', | |
'PureComponent', | |
'Fragment', | |
'Children', | |
'createElement', | |
'createContext', | |
'forwardRef', | |
'useCallback', | |
'useContext', | |
'useEffect', | |
'useLayoutEffect', | |
'useMemo', | |
'useReducer', | |
'useRef', | |
'useState', | |
'useImperativeHandle', | |
'useDebugValue', | |
], | |
'node_modules/react-dom/index.js': ['unstable_batchedUpdates'], | |
'node_modules/react-is/index.js': [ | |
'isContextConsumer', | |
'isValidElementType', | |
], | |
}, | |
}), | |
// visualizer(), | |
filesize(), | |
browsersync({ | |
server: { | |
baseDir: 'public', | |
}, | |
middleware: [ | |
proxy('/Content/', { | |
target: 'http://localhost:62678', | |
pathRewrite: { | |
'^/Content': 'http://localhost:62678/Content', | |
}, | |
changeOrigin: true, | |
}), | |
proxy('/signalr/', { | |
target: 'http://localhost:62678', | |
ws: true, | |
pathRewrite: { | |
'^/signalr': 'http://localhost:62678/signalr', | |
}, | |
changeOrigin: true, | |
}), | |
], | |
}), | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment