Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Add the case-sensitive-paths-webpack-plugin webpack plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Pejoski committed Aug 6, 2017
1 parent f8d518d commit 666166a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"case-sensitive-paths-webpack-plugin": "^2.1.1",
"chalk": "^2.0.1",
"clean-webpack-plugin": "^0.1.16",
"commander": "^2.9.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import SimpleModule from './SimpleModule'

console.log(SimpleModule)
Empty file.
13 changes: 13 additions & 0 deletions spec/integration/index.integration-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('[integration] sagui', function () {
const projectContentWithPrettierErrorsInSaguiConfig = path.join(__dirname, '../fixtures/project-content-with-prettier-errors-in-sagui-config')
const projectContentCustomPrettierOptionsInEslintrc = path.join(__dirname, '../fixtures/project-content-with-custom-prettier-options-in-eslintrc')
const projectContentWithDynamicImports = path.join(__dirname, '../fixtures/project-content-with-dynamic-import')
const projectContentWithCaseMismatchInModulePath = path.join(__dirname, '../fixtures/project-with-case-mismatch-in-module-paths')
let projectPath, projectSrcPath

beforeEach(function () {
Expand Down Expand Up @@ -369,5 +370,17 @@ npm-debug.log`)
await sagui({ projectPath, action: actions.BUILD })
})
})

describe('when there is case mismatch in module paths', () => {
it('`build` should break', async () => {
fs.copySync(projectContentWithCaseMismatchInModulePath, projectPath, { overwrite: true })

await sagui({ projectPath, action: actions.BUILD })
.then(
() => { throw new Error('It should have failed because of case mismatch in module path')},
(error) => expect(error.message).to.eql('Build failed')
)
})
})
})
})
2 changes: 2 additions & 0 deletions src/configure-webpack/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin'
import CleanWebpackPlugin from 'clean-webpack-plugin'
import merge from 'webpack-merge'
import path from 'path'
Expand Down Expand Up @@ -79,6 +80,7 @@ const buildSharedWebpackConfig = (saguiConfig) => {
verbose: false
})] : []),

new CaseSensitivePathsPlugin(),
new DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
Expand Down

0 comments on commit 666166a

Please sign in to comment.