Skip to content

Commit

Permalink
Merge pull request #30 from SPANDigital/develop
Browse files Browse the repository at this point in the history
v0.2.2
  • Loading branch information
taylageben authored Nov 20, 2018
2 parents 61b2df9 + 490ae90 commit b9c9917
Show file tree
Hide file tree
Showing 22 changed files with 18,423 additions and 597 deletions.
27 changes: 27 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"rules": {
"quotes": [
2,
"single"
],
"strict": [
2,
"never"
],
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2
},
"plugins": [
"react"
]
}
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ node_js:
cache:
directories:
- node_modules
install: npm install
script:
install:
- npm install
- npm run build
script:
- mv dist/presidium.js dist/presidium-$TRAVIS_BRANCH.js
if: branch IN (master, develop) AND NOT type = pull_request
deploy:
- provider: s3
access_key_id: $S3_ACCESS_KEY
Expand Down
79 changes: 57 additions & 22 deletions etc/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
var CopyWebpackPlugin = require('copy-webpack-plugin');
var webpack = require('webpack');
var path = require('path');

var buildPath = path.join(__dirname, '../dist');
var buildFileName = 'presidium.js';
var fullFilePath = buildPath + '/' + buildFileName;

module.exports = {
entry: './src/index.js',
Expand All @@ -13,36 +11,73 @@ module.exports = {
publicPath: '/'
},
plugins: [
new CopyWebpackPlugin([
{
from: fullFilePath,
to: '../../presidium-template/dist/site/media/js'
}
]),
new CopyWebpackPlugin([
{
from: fullFilePath,
to: '../../presidium-template/node_modules/presidium-core/media/js/'
},
]),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
PRESIDIUM_VERSION: JSON.stringify(process.env.npm_package_version),
})
],

module: {
rules: [
{
loader: 'babel-loader',
test: /\.js$/,
include: path.join(__dirname, '../src'),
use: ['react-hot-loader', 'babel-loader'],
},
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader', 'eslint-loader']
},
{
test: /\.css/,
exclude: /node_modules/,
query: {
presets: ['react', 'es2015']
use: ['style-loader', 'css-loader', 'resolve-url'],
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.(jpe?g|png|gif)$/i,
use: [
'file-loader?hash=sha512&digest=hex&name=img/[name].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
},
{
test: /\.(ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: {
loader: 'file-loader'
}
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: {
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
}
},
{
test: /\.svg$/,
use: [
{
loader: 'babel-loader'
},
{
loader: 'react-svg-loader',
options: {
jsx: true // true outputs JSX tags
}
}
]
}
]
},
resolve: {
extensions: ['.js', '.jsx']
},
devServer: {
historyApiFallback: true,
port: 8009,
overlay: {warnings: true, errors: true},
hot: true,
contentBase: '/'
}
};
6 changes: 3 additions & 3 deletions etc/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ module.exports = {
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': '"production"'
}
PRESIDIUM_VERSION: JSON.stringify(process.env.npm_package_version),
'process.env.NODE_ENV': JSON.stringify('production')

}),
new UglifyJsPlugin()
]
Expand Down
Loading

0 comments on commit b9c9917

Please sign in to comment.