Skip to content

Commit

Permalink
Build working again
Browse files Browse the repository at this point in the history
  • Loading branch information
arqex committed Jan 19, 2020
1 parent f54d5af commit 45a935e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 1,478 deletions.
356 changes: 0 additions & 356 deletions config/dist/react-datetime.cjs.js

This file was deleted.

370 changes: 0 additions & 370 deletions config/dist/react-datetime.umd.js

This file was deleted.

23 changes: 19 additions & 4 deletions config/webpack.config.build.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
const paths = require('./paths');
const path = require('path');

const outputPath = path.join(__dirname, '../dist/');

const baseConfig = {
entry: ['./src/datetime/DateTime.js'],
mode: 'development',
mode: 'production',

resolve: {
extensions: ['.js']
},

externals: {
'react': 'React',
'react-dom': 'ReactDOM',
'react-dom': 'react-dom',
'moment': 'moment',
'moment-timezone': 'moment-timezone'
},

module: {
rules: [
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader')
}
]
}
};

const umdConfig = {
...baseConfig,
output: {
path: __dirname + '/dist/',
path: outputPath,
library: 'Datetime',
libraryTarget: 'umd',
filename: 'react-datetime.umd.js',
Expand All @@ -28,7 +43,7 @@ const umdConfig = {
const cjsConfig = {
...baseConfig,
output: {
path: __dirname + '/dist/',
path: outputPath,
library: 'Datetime',
libraryTarget: 'commonjs2',
filename: 'react-datetime.cjs.js',
Expand Down
362 changes: 1 addition & 361 deletions dist/react-datetime.cjs.js

Large diffs are not rendered by default.

376 changes: 1 addition & 375 deletions dist/react-datetime.umd.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"license": "MIT",
"peerDependencies": {
"moment": "^2.16.0",
"react": "^16.5.0",
"react-dom": "^16.5.0"
"react": "^16.5.0"
},
"devDependencies": {
"@babel/core": "7.7.4",
Expand Down
9 changes: 0 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ import React from 'react';
import moment from 'moment';
import DateTime from './datetime/DateTime';

function renderView( viewType, renderDefault ) {
return (
<div className="customView">
<span className="viewType">{ viewType }</span>
{ renderDefault() }
</div>
);
}

class App extends React.Component {

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion test/testUtils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'; // eslint-disable-line no-unused-vars
import { mount, shallow } from 'enzyme';
import Datetime from '../src/datetime/DateTime'; // eslint-disable-line no-unused-vars
import Datetime from '../dist/react-datetime.cjs'; // eslint-disable-line no-unused-vars

const _simulateClickOnElement = (element) => {
if (element.length === 0) {
Expand Down

0 comments on commit 45a935e

Please sign in to comment.