diff --git a/app/polymer/package.json b/app/polymer/package.json index d9baf846c19c..e2ed02b08b7d 100644 --- a/app/polymer/package.json +++ b/app/polymer/package.json @@ -48,7 +48,6 @@ "global": "^4.3.2", "html-webpack-plugin": "^2.30.1", "json5": "^0.5.1", - "polymer-webpack-loader": "2.0.1", "react": "^16.0.0", "react-dev-utils": "^5.0.0", "react-dom": "^16.0.0", @@ -59,10 +58,12 @@ "webpack-hot-middleware": "^2.21.2" }, "devDependencies": { - "nodemon": "^1.17.1" + "nodemon": "^1.17.1", + "polymer-webpack-loader": "^2.0.1" }, "peerDependencies": { "babel-core": "^6.26.0 || ^7.0.0-0", - "babel-runtime": ">=6.0.0" + "babel-runtime": ">=6.0.0", + "polymer-webpack-loader": ">=2.0.0" } } diff --git a/examples/polymer-cli/package.json b/examples/polymer-cli/package.json index 2725de7caf06..521f5bfffb67 100644 --- a/examples/polymer-cli/package.json +++ b/examples/polymer-cli/package.json @@ -19,7 +19,7 @@ "@storybook/polymer": "^3.4.0-rc.0", "@webcomponents/webcomponentsjs": "^1.1.0", "global": "^4.3.2", - "polymer-webpack-loader": "^2.0.0", + "polymer-webpack-loader": "^2.0.1", "webpack": "^3.11.0" }, "devDependencies": { diff --git a/lib/cli/generators/POLYMER/index.js b/lib/cli/generators/POLYMER/index.js index 1a1ab70f2cef..90d7bcffdb1e 100755 --- a/lib/cli/generators/POLYMER/index.js +++ b/lib/cli/generators/POLYMER/index.js @@ -3,10 +3,16 @@ import path from 'path'; import { getVersions, getPackageJson, writePackageJson } from '../../lib/helpers'; export default async () => { - const [storybookVersion, babelCoreVersion, babelRuntimeVersion] = await getVersions( + const [ + storybookVersion, + babelCoreVersion, + babelRuntimeVersion, + polymerLoaderVarion, + ] = await getVersions( '@storybook/polymer', 'babel-core', - 'babel-runtime' + 'babel-runtime', + 'polymer-webpack-loader' ); mergeDirs(path.resolve(__dirname, 'template'), '.', 'overwrite'); @@ -22,6 +28,12 @@ export default async () => { if (!packageJson.dependencies['babel-runtime'] && !packageJson.devDependencies['babel-runtime']) { packageJson.devDependencies['babel-runtime'] = babelRuntimeVersion; } + if ( + !packageJson.dependencies['polymer-webpack-loader'] && + !packageJson.devDependencies['polymer-webpack-loader'] + ) { + packageJson.devDependencies['polymer-webpack-loader'] = polymerLoaderVarion; + } packageJson.scripts = packageJson.scripts || {}; packageJson.scripts.storybook = 'start-storybook -p 6006'; diff --git a/lib/cli/test/snapshots/polymer/package.json b/lib/cli/test/snapshots/polymer/package.json index c16dbce80a70..af7cd677c113 100644 --- a/lib/cli/test/snapshots/polymer/package.json +++ b/lib/cli/test/snapshots/polymer/package.json @@ -14,6 +14,7 @@ "devDependencies": { "@storybook/polymer": "^3.4.0-rc.0", "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0" + "babel-runtime": "^6.26.0", + "polymer-webpack-loader": "^2.0.1" } } diff --git a/package.json b/package.json index 64265da20d00..4c47466159de 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "lint-staged": "^7.0.0", "lodash": "^4.17.5", "npmlog": "^4.1.2", + "polymer-webpack-loader": "^2.0.1", "prettier": "^1.11.1", "raf": "^3.4.0", "react": "^16.2.0", diff --git a/yarn.lock b/yarn.lock index 9889a9fc2a59..27d63611c66c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11703,7 +11703,7 @@ pngjs@^3.0.0, pngjs@^3.3.0: version "3.3.1" resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.3.1.tgz#8e14e6679ee7424b544334c3b2d21cea6d8c209a" -polymer-webpack-loader@2.0.1, polymer-webpack-loader@^2.0.0: +polymer-webpack-loader@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/polymer-webpack-loader/-/polymer-webpack-loader-2.0.1.tgz#d15d45328f6a6700366dfaee83fc606f39cdcee0" dependencies: