Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add webpack-defaults #34

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"presets": [
[
"env",
{
"useBuiltIns": true,
"targets": {
"node": 4.3
},
"exclude": [
"transform-async-to-generator",
"transform-regenerator"
]
}
]
],
"plugins": [
[
"transform-object-rest-spread",
{
"useBuiltIns": true
}
]
],
"env": {
"test": {
"presets": [
"env"
],
"plugins": [
"transform-object-rest-spread"
]
}
}
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[.md]
insert_final_newline = false
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/dist
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "webpack"
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
yarn.lock -diff
* text=auto
bin/* eol=lf
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Check the version of package you are using. If it's not the newest version, update and try again (see changelog while updating!).
2. If the issue is still there, write a minimal project showing the problem and expected output.
3. Link to the project and mention Node version and OS in your report.

**IMPORTANT! You should use [Stack Overflow](https://stackoverflow.com/) for support related questions.**
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
1. [Read and sign the CLA](https://cla.js.foundation/webpack/webpack.js.org). This needs to be done only once. PRs that haven't signed it won't be accepted.
2. Check out the [development guide](https://webpack.js.org/development/) for the API and development guidelines.
3. Read through the PR diff carefully as sometimes this can reveal issues. The work will be reviewed, but this can save some effort.
-->
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
node_modules
node_modules
logs
*.log
npm-debug.log*
yarn-debug.log*
.eslintcache
/coverage
/dist
/local
/reports
/node_modules
.DS_Store
Thumbs.db
.idea
.vscode
*.sublime-project
*.sublime-workspace
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
sudo: false
language: node_js
branches:
only:
- master
matrix:
fast_finish: true
include:
- os: linux
node_js: '7'
env: WEBPACK_VERSION="2.2.0" JOB_PART=lint
- os: linux
node_js: '4.3'
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
- os: linux
node_js: '6'
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
- os: linux
node_js: '7'
env: WEBPACK_VERSION="2.2.0" JOB_PART=coverage
before_install:
- nvm --version
- node --version
before_script:
- |-
if [ "$WEBPACK_VERSION" ]; then
yarn add webpack@^$WEBPACK_VERSION
fi
script:
- 'yarn run travis:$JOB_PART'
after_success:
- 'bash <(curl -s https://codecov.io/bash)'
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Change Log

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

x.x.x / <year>-<month>-<day>
==================

* Bug fix -
* Feature -
* Chore -
* Docs -
20 changes: 20 additions & 0 deletions LOADER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<a name="loader"></a>

## loader(source, map) ⇒ <code>function</code>
Coffee Loader

> Loads and compiles CoffeeScript (`.coffee`) files

**Kind**: global function
**Returns**: <code>function</code> - cb Callback
**Requires**: <code>module:path</code>, <code>module:loaderUtils</code>, <code>module:schemaUtils</code>, <code>module:coffeescript</code>
**Version**: 1.0.0
**Author**: Tobias Koppers (@sokra)
Michael Ciniawsky (@michael-cinaiwsky) <michael.ciniawsky@gmail.com>
**License**: MIT

| Param | Type | Description |
| --- | --- | --- |
| source | <code>String</code> | Coffeescript Source |
| map | <code>String</code> | Coffeescript Sourcemap |

84 changes: 38 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img width="160" height="160"
src="https://cdn.worldvectorlogo.com/logos/coffeescript.svg">
<a href="https://github.com/webpack/webpack">
<img width="200" height="200" hspace="20"
<img width="200" height="200" hspace="30"
src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
<h1>Coffee Loader</h1>
Expand All @@ -18,21 +18,19 @@
<h2 align="center">Install</h2>

```bash
npm install --save-dev coffee-loader
npm install --save-dev coffee-loader coffeescript
```

<h2 align="center">Usage</h2>

### CoffeeScript 2 (Beta)

```js
import coffee from 'coffee-loader!./file.coffee';
```bash
npm install --save-dev coffee-loader coffeescript@next
```

### Configuration (recommended)

<h2 align="center">Usage</h2>

```js
import coffee from 'file.coffee';
import file from 'file.coffee';
```

**webpack.config.js**
Expand All @@ -51,50 +49,38 @@ module.exports = {

<h2 align="center">Options</h2>

|Name|Default|Description|
|:--:|:-----:|:----------|
|**`literate`**|`false`|Enable CoffeeScript in Markdown (Code Blocks) e.g `file.coffee.md`|
|**`sourceMap`**|`false`|Enable/Disable Sourcemaps|
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|**`literate`**|`{Boolean}`|`false`|Enable CoffeeScript in Markdown (Code Blocks) e.g `file.coffee.md`|
|**`sourceMap`**|`{Boolean}`|`false`|Enable/Disable Sourcemaps|

### [Literate](http://coffeescript.org/#literate)

**webpack.config.js**
```js
module.exports = {
module: {
rules: [
{
test: /\.coffee.md$/,
use: [
{
loader: 'coffee-loader',
options: { literate: true }
}
]
}
]
}
{
test: /\.coffee.md$/,
use: [
{
loader: 'coffee-loader',
options: { literate: true }
}
]
}
```

### Sourcemaps
### SourceMaps

**webpack.config.js**
```js
module.exports = {
module: {
rules: [
{
test: /\.coffee$/,
use: [
{
loader: 'coffee-loader',
options: { sourceMap: true }
}
]
}
]
}
{
test: /\.coffee$/,
use: [
{
loader: 'coffee-loader',
options: { sourceMap: true }
}
]
}
```

Expand All @@ -105,28 +91,34 @@ module.exports = {
<tr>
<td align="center">
<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/166921?v=3&s=150">
src="https://github.com/bebraw.png?v=3&s=150">
</br>
<a href="https://github.com/bebraw">Juho Vepsäläinen</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=150">
src="https://github.com/d3viant0ne.png?v=3&s=150">
</br>
<a href="https://github.com/d3viant0ne">Joshua Wiens</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/533616?v=3&s=150">
src="https://github.com/SpaceK33z.png?v=3&s=150">
</br>
<a href="https://github.com/SpaceK33z">Kees Kluskens</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/3408176?v=3&s=150">
src="https://github.com/TheLarkInn.png?v=3&s=150">
</br>
<a href="https://github.com/TheLarkInn">Sean Larkin</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://github.com/michael-ciniawsky.png?v=3&s=150">
</br>
<a href="https://github.com/michael-ciniawsky">Michael Ciniawsky</a>
</td>
</tr>
<tbody>
</table>
Expand Down
42 changes: 0 additions & 42 deletions index.js

This file was deleted.

Loading