Skip to content

Commit

Permalink
Merge pull request #1841 from friday/ssr
Browse files Browse the repository at this point in the history
Support universal builds ("SSR")
  • Loading branch information
tchakabam authored Aug 8, 2018
2 parents 846a748 + 8f09e5e commit 335158b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ npm install
if [ "${TRAVIS_MODE}" = "build" ]; then
npm run lint
npm run build
# check that hls.js doesn't error if requiring in node
# see https://github.com/video-dev/hls.js/pull/1642
node -e 'require("./" + require("./package.json").main)'
elif [ "${TRAVIS_MODE}" = "unitTests" ]; then
npm run test:unit
elif [ "${TRAVIS_MODE}" = "funcTests" ]; then
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function getPluginsForConfig(type, minify = false) {
);

const plugins = [
new webpack.BannerPlugin({ entryOnly: true, raw: true, banner: 'typeof window !== "undefined" &&' }), // SSR/Node.js guard
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.DefinePlugin(defineConstants)
];
Expand Down

0 comments on commit 335158b

Please sign in to comment.