-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from webpack-contrib/docs/source-map-example
docs: add source map example
- Loading branch information
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE> | ||
<html> | ||
<head> | ||
<script src="/bundle.js"></script> | ||
</head> | ||
<body> | ||
<div class="box"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import "./other.less"; | ||
|
||
.box:extend(.hotpink) { | ||
width: 200px; | ||
height: 200px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.hotpink { | ||
background: hotpink; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "source-maps-example", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "webpack-dev-server", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"css-loader": "^0.27.3", | ||
"style-loader": "^0.14.1", | ||
"less-loader": "^4.0.0", | ||
"webpack": "^2.2.1", | ||
"webpack-dev-server": "^2.4.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module.exports = { | ||
entry: require.resolve('./main.less'), | ||
output: { | ||
filename: 'bundle.js', | ||
}, | ||
devtool: 'eval', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.less$/, | ||
use: [ | ||
'style-loader', | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
sourceMap: true, | ||
}, | ||
}, | ||
{ | ||
loader: require.resolve('../../dist'), | ||
options: { | ||
sourceMap: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
devServer: { | ||
inline: true, | ||
}, | ||
}; |