Skip to content

Commit a5339f1

Browse files
committed
changed deploy
1 parent 7a30750 commit a5339f1

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-keyboard-time-input",
33
"version": "2.0.5",
44
"description": "A keyboard friendly react component for capturing time",
5-
"module": "./dist/commonjs/TimeInput",
5+
"module": "./src/TimeInput",
66
"main": "./dist/TimeInput",
77
"scripts": {
88
"predeploy-docs": "./node_modules/.bin/webpack --config webpack.config.js",
@@ -12,10 +12,11 @@
1212
"test": "jest --coverage",
1313
"coverage-ci": "codecov",
1414
"start": "webpack-dev-server --config webpack.config.js",
15-
"compile": "NODE_ENV=production babel -d dist/ src/",
16-
"compile:common": "BABEL_ENV=commonjs NODE_ENV=production babel -d dist/commonjs/ src/",
15+
"compile:common-one-file": "BABEL_ENV=commonjs NODE_ENV=production ./node_modules/.bin/webpack --config webpack.commonjs.config.js",
16+
"compile:es": "NODE_ENV=production ./node_modules/.bin/webpack --config webpack.es.config.js",
17+
"compile": "BABEL_ENV=commonjs NODE_ENV=production babel src/ --out-dir ./dist",
1718
"preprepublish": "yarn run test",
18-
"prepublish": "yarn run compile && yarn run compile:common"
19+
"prepublish": "yarn run compile"
1920
},
2021
"author": "Alan Clarke <hi@alz.so> (alz.so)",
2122
"contributors": [
@@ -29,6 +30,7 @@
2930
"babel-core": "^6.26.0",
3031
"babel-jest": "^22.0.6",
3132
"babel-loader": "7.1.2",
33+
"babel-plugin-transform-rename-import": "^2.1.1",
3234
"babel-preset-env": "^1.6.1",
3335
"babel-preset-es2015": "^6.24.1",
3436
"babel-preset-react": "^6.24.1",

webpack.commonjs.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
4+
module.exports = {
5+
devtool: 'source-map',
6+
entry: './src/TimeInput.js',
7+
output: {
8+
path: path.join(__dirname, 'dist'),
9+
filename: 'commonjs.js',
10+
library: 'TimeInput',
11+
libraryTarget: 'commonjs'
12+
},
13+
plugins: [
14+
new webpack.DefinePlugin({
15+
'process.env.NODE_ENV': JSON.stringify('production')
16+
}),
17+
new webpack.NoEmitOnErrorsPlugin()
18+
],
19+
module: {
20+
loaders: [
21+
{
22+
test: /\.js$/,
23+
loader: 'babel-loader',
24+
include: __dirname,
25+
exclude: /node_modules/
26+
}
27+
]
28+
}
29+
};

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,10 @@ babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^
834834
dependencies:
835835
regenerator-transform "^0.10.0"
836836

837+
babel-plugin-transform-rename-import@^2.1.1:
838+
version "2.1.1"
839+
resolved "https://registry.yarnpkg.com/babel-plugin-transform-rename-import/-/babel-plugin-transform-rename-import-2.1.1.tgz#2ec975543a0a934404db4c4991759ff48a219a32"
840+
837841
babel-plugin-transform-strict-mode@^6.24.1:
838842
version "6.24.1"
839843
resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"

0 commit comments

Comments
 (0)