Skip to content

Commit

Permalink
feat(all): initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
niieani committed Jun 19, 2016
0 parents commit c01364d
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules
.idea
.vscode
npm-debug.log*
/typings
/dist
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/typings
/.vscode
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
sudo: false
language: node_js
cache:
directories:
- node_modules
notifications:
email: false
node_js:
- 6
before_install:
- npm i -g npm
before_script:
- npm prune
- npm install @easy-webpack/core webpack@beta
after_success:
- npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Bazyli Brzóska

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Empty file added README.md
Empty file.
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@easy-webpack/config-global-jquery",
"description": "Easy Webpack configuration function for global-jquery",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "TS_NODE_FAST=true TS_NODE_NO_PROJECT=true ava",
"postinstall": "typings install",
"build": "rimraf dist && tsc -p .",
"semantic-release": "npm run build && semantic-release pre && npm publish --access=public && semantic-release post"
},
"repository": {
"type": "git",
"url": "https://github.com/easy-webpack/config-global-jquery.git"
},
"keywords": [
"global-jquery",
"webpack",
"easy",
"configurator",
"configuration",
"config",
"simple"
],
"author": "Bazyli Brzóska <bazyli.brzoska@gmail.com> (https://invent.life)",
"license": "MIT",
"bugs": {
"url": "https://github.com/easy-webpack/config-global-jquery/issues"
},
"homepage": "https://github.com/easy-webpack/config-global-jquery#readme",
"devDependencies": {
"ava": "^0.15.2",
"semantic-release": "^4.3.5",
"ts-node": "^0.9.1",
"tslint": "^3.11.0",
"tslint-config-standard": "^1.2.2",
"typescript": ">=1.9.0-dev.20160619-1.0 || ^2.0.0",
"typings": "^1.3.0"
},
"dependencies": {
"jquery": "^3.0.0"
},
"peerDependencies": {
"@easy-webpack/core": "*"
},
"ava": {
"files": [
"test/**/*.{ts,js}"
],
"tap": false,
"require": [
"ts-node/register"
]
}
}
16 changes: 16 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {WebpackConfig, get} from '@easy-webpack/core'
import * as webpack from 'webpack'

export function jQuery() {
return function jQuery(this: WebpackConfig): WebpackConfig {
return {
plugins: [
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery' // this doesn't expose jQuery property for window, but exposes it to every module
})
].concat(get(this, 'plugins', []))
}
}
}
6 changes: 6 additions & 0 deletions test/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import test from 'ava'
import {assign} from '../src'

test(`dummy`, t => {
t.true(true)
})
20 changes: 20 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"experimentalDecorators": true,
"moduleResolution": "node",
"allowJs": false,
"declaration": true,
"outDir": "dist",
"rootDir": "src",
"sourceMap": true,
"lib": ["es6"]
},
"exclude": [
"node_modules",
"dist",
"test",
"example"
]
}
3 changes: 3 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "tslint-config-standard"
}
12 changes: 12 additions & 0 deletions typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"dependencies": {
"debug": "registry:npm/debug#2.0.0+20160511151334",
"lodash": "registry:npm/lodash#4.0.0+20160416211519"
},
"globalDependencies": {
"node": "registry:env/node#6.0.0+20160610031852",
"source-map": "registry:dt/source-map#0.0.0+20160317120654",
"uglify-js": "registry:dt/uglify-js#2.6.1+20160316155526",
"webpack": "registry:dt/webpack#1.12.9+20160523035535"
}
}

0 comments on commit c01364d

Please sign in to comment.